Sunday 8 January 2017

How to Connect JDBC with Oracle RAC for Failover Testing.

Hi Guys,

Please follow below Steps to connect JDBC with Oracle.

1.Install Oracle 11g CLient in your Machine.
2.Create JDBC Program in Eclipse
3.in JDBC Program mention below thng in code
                 user = xxx
password = xxxxx
database = xxxxx    //TNSnames.ora file 

           URL("jdbc:oracle:oci:@" + database);
4.Go to XXXXX\product\11.2.0\client_2\network\admin\tnsnames.ora

database=
    (DESCRIPTION =  (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx)(PORT = 1521))
           (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xxxxx)))

5.InEclipse Add Jar
     xxxxx\product\11.2.0\client_2\jdbc\lib
6.Set Class Path
7.Run your Program.
8.Go to Oracle Server
9.Down Any Node
10.The traffic should move to another Node.


Thanks~
If you have any concern,Please revert back to me.

No comments:

Post a Comment