JDBC: What is the correct JDBC URL to connect to a RAC database

Posted by Vinnie on Stack Overflow See other posts from Stack Overflow or by Vinnie
Published on 2009-10-29T21:22:08Z Indexed on 2010/04/30 16:37 UTC
Read the original article Hit count: 637

Filed under:
|

Hi,

We were connecting to Oracle from our code with a simple (custom) JDBC connector class. This class reads the connection properties from a resource file and tries to make a connection to Oracle (thin connection).

However, recently the database have moved to a RAC and now the application is unable to connect to the DB.

Here is the TNSPING output:

Used LDAP adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=tst-db1.myco.com)(PORT=1604))
(ADDRESS=(PROTOCOL=TCP)(HOST=tst-db2.myco.com)(PORT=1604)))(CONNECT_DATA=    
SERVICE_NAME=mydb1.myco.com)(SERVER=DEDICATED)))
OK (80 msec)

What would be the correct URL to specify in this case.

Regards,

  • Ashish

© Stack Overflow or respective owner

Related posts about java

Related posts about jdbc