Then you could test the connection by:
tnsping (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mydb.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MYSERVICE)))
And then used this information int the connect string as below:
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mydb.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MYSERVICE)))
Note that, this is service name using issue, if you have chance to use SID name like INST1, old fashion connection string use will not be a problem, like below:
jdbc:oracle:thin:@mydb.com:1521:INST1
No comments:
Post a Comment