File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes JDBC code for oracle RAC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Reply locked New topic

JDBC code for oracle RAC

Sushil Suvarna

Joined: May 28, 2004
Posts: 14
Can somebody give me the jdbc code to connect to oracle rac.

Jyothi Lature
Ranch Hand

Joined: Oct 31, 2001
Posts: 60

I dont think there will be any change in the code part, except that you might have to have a JDBC driver (for ex: Oracle Thin driver) that supports Oracle RAC(Oracle Real Application Clusters).

In case if you are using Weblogic Application Server, then you can refer to this link which will help you in setting up the connection to Oracle RAC..

Hope this helps..

Jyothi<br />Sun Certified Java Programmer<br />Brainbench Certified for Javascript
Jyothi Lature
Ranch Hand

Joined: Oct 31, 2001
Posts: 60

JDBC thin driver does not use tnsnames.ora to make a connection.
Using a tnsname here instead of the SID is quite an easy error to make. If it is a name in your TNS file, then replace the host string name with the network name of the Oracle server. That should resolve your problem.

Also, to add to this, some extra info with regard to OCI and Thin driver is...

The JDBC OCI driver provides an implementation of the JDBC interfaces using the Oracle Call Interface (OCI).
The JDBC OCI driver requires an Oracle client installation including Net8.

The JDBC Thin driver establishes a direct connection to the database server using Java Sockets.
The JDBC Thin driver does not require Oracle software on the client side; however, there must be an Oracle listener process correctly installed on the Oracle server.

Hope this helps.

Please donot use Display Name for the Topic, as this will not help anybody to understand what the topic is all about.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Sushil, please respond in the the same topic rather than starting new ones. Please continue this discussion here.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JDBC code for oracle RAC
It's not a secret anymore!