JDBC url for oracle RAC
Posted by Enrico Giurin Thu, 12 Apr 2007 01:07:00 GMT
If you have to connect to oracle RAC (Real Application Cluster) using JDBC with thin driver, the classic url:jdbc:oracle:thin:@<HOST>:1521:<SID>Instead, you must use this url:
jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service)))



I kept getting this error over and over. I was hoping that a simple copy paste will solve it, as I just got sooooo annoyed from trying to solve it in the last 2 hours… and praise the lord it worked :) Changing the URLs as u stated did the trick and the connection worked flawlessly.
THANKS A LOT !
Thanks Enrico , it is very helpful for me
Unfortunately for me even this didn’t work. I’m using a WebSphere 5 server with connection pools on a system with a 9i client connecting to a 10g RAC. When the client didn’t work I tried using jdbc as above, however I still get : Connection not available while invoking method queueRequest for resource jdbc/racserver. I can test the connection successfully but can’t create a pooled connection. J2CA0020E: The Connection Pool Manager could not allocate a Managed Connection: com.ibm.websphere.ce.j2c.ConnectionWaitTimeoutException
Thanks alot, this artical help me much
Use this url: jdbc:oracle:thin:@host1^host2:1521:service_name
Thanks a lot for the posting.. It helped us to get through
Some oracle forum posts seems to suggest that there is some issue with DB, but this post really helped.
Gracias…
hi i already tried this method and failed as the connection fails 5/10 times. Please help me out from this problem..Thank you in advance
you can reach me at majetyravi@gmail.com
This does help a lot. thanks for this. Keep posting such tricks.