My Oracle Support Banner

JDBC Thin 19c Fails With java.sql.SQLException: Invalid Oracle URL specified When Password Has Hyphen(-) Character (Doc ID 2726070.1)

Last updated on MAY 30, 2023

Applies to:

JDBC - Version 12.2.0.0.0 to 19.7 [Release 12c to 18c]
Information in this document applies to any platform.

Symptoms

The connection is established without issues when using JDBC 11.2.0.4.0, but fails when the driver is upgraded to JDBC 12.2.0.1.0 or higher.

Full exception:

Exception in thread "main" java.lang.RuntimeException: Invalid Oracle URL specified
  at com.<NAME>.MyClass.myMethod(<CLASS NAME>.java:130)
  at com.<NAME>.MyClass.main(<CLASS NAME>.java:62)
Caused by: java.sql.SQLException: Invalid Oracle URL specified
  at oracle.jdbc.driver.PhysicalConnection.parseUrl(PhysicalConnection.java:1335)
  at oracle.jdbc.driver.PhysicalConnection.readConnectionProperties(PhysicalConnection.java:1035)
  at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:747)
  at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:498)
  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:56)
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:747)
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562)
  at java.sql.DriverManager.getConnection(DriverManager.java:664)
  at java.sql.DriverManager.getConnection(DriverManager.java:270)

   ::::::::::


However, connectivity works fine with SQL*Plus 19c to the same database using the same credentials.

Note1:  The special characters allowed in 12c passwords are:  ‘ ~ ! @ # $ % ^ & * ( ) _ - + = { } [ ] \ / < > , . ; ? ' : | (space) 
Note2:  In the above tests, the password contained a hyphen (-) character.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.