Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jdbc and tnsnames - is it possible?

834098Mar 21 2011 — edited Mar 23 2011
Using Oracle Enterprise 11.0.1.7.0 on 64 bit RHEL, jdbc ojdbc6.jar
I have this jdbc thin connect string which works fine using the 'traditional' url:port:sid

String url = "jdbc:oracle:thin:@//ora-clu2b-vip:1541/TESTLIT"

with this I can connect and retrieve rows etc.

However I am trying to use the tnsnames.ora in the URL which I have read is possible to do after 10g, but if I alter the connection to this:

String url = "jdbc:oracle:thin:@littest"

it throws

java.sql.SQLException: Io exception: SO Exception was generated
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)


Am I making an obvious error which Iam failing to spot, or have other ppl had similar problems. I should also mention this is a RAC
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2011
Added on Mar 21 2011
6 comments
1,785 views