I have an Oracle database with LDAP, and can connect by writing smth like:
jdbc:oracle:thin:@ldap://oid0.wow.com:666/chost,cn=OracleContext,dc=wow,dc=com
But this is not failover (we have another server with Oracle LDAP – oid1.wow.com:666)
How can I use both servers to reach failover?
I found this solution, but it doesn’t work:
java.sql.SQLException: Io exception: Invalid LDAP URL specified
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:113)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:147)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:257)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:389)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
It was a driver!
Throw debugging I’ve found antother issue with String.concat() NPE
Our driver (com.oracle ojdbc14 10.2.0.4.0 – found in MVN repo) doesn’t suppor two o more URL’s.
When I downloaded driver from Oracle site (10.1.0.5 ‘ojdbc14_g’) all start work fine.
All of this looks strange because 10.1.0.5 seems to be the last version of Oracle JDBC drivers on official site (for Oracle 10 of course).
Here is! Failover dataSource bean: