I am trying to connect to an RAC database through JDBC with the connection string in properties file.
Here is the properties file.
datasource-url=jdbc\:oracle\:thin\:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(FAILOVER=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=171.17.aa.ee)(PORT=21521))(ADDRESS=(PROTOCOL=TCP)(HOST=171.17.aa.dd)(PORT=21521))(ADDRESS=(PROTOCOL=TCP)(HOST=171.17.aa.cc)(PORT=21521))(ADDRESS=(PROTOCOL=TCP)(HOST=171.17.aa.bb)(PORT=21521)))(CONNECT_DATA=SERVICE_NAME=ssss)(SERVER=DEDICATED)))
datasource-username=xxxx
datasource-password=yyyy
driver-class=oracle.jdbc.driver.OracleDriver
I am reading this properties file from java code where I create a connection. Unfortunately, I am getting these two exceptions.
SQLException-Invalid connection string format, a valid format is: "host:port:sid"
SQLException-NL Exception
What is wrong here? Thanks in advance.
EDIT 1: I was using odbc14.jar , So I thought of using some other jar. I used odbc7.jar and these 2 exceptions vanished but got a new exception-- SO Exception was generated.
My jdk version is 1.7