| Author |
Oracle JDBC - DSN Connection
|
Arun Mariappan K
Greenhorn
Joined: Jun 28, 2010
Posts: 4
|
|
Hi,
I need to connect the Oracle 10g with DSN connection named "asset". can you please kindly mention the syntax for that.
Currently i am using the below syntax. But i got "ORA-12505, TNS:listener does not currently know of SID given in connect descriptor"
Do i missed anything. please help me.
Thanks in advance.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
You shouldn't need a DNS for Oracle. The error you see is because your tnsnames does not include an entiry for the service "asset". Note, you don't need a tnsnames entry if you include the host. Have a look at Oracle's JDBC page.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Arun Mariappan K
Greenhorn
Joined: Jun 28, 2010
Posts: 4
|
|
Hi Paul,
Thanks for your help.
My Requirement is to use only the DSN for the Oracle 10g connection. Initially i have used JDBC:ODBC and connects well as mentioned below,
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc dbc:asset","uid","pwd");
But i like to connect with JDBC:ORACLE. So i need the connection syntax using DSN.
Could you please help me?
Thanks in advance.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
But i like to connect with JDBC:ORACLE. So i need the connection syntax using DSN.
Like I said, you don't need a DNS to do this. With regards to its syntax, doesn't the ODBC tool build this for you?
|
 |
 |
|
|
subject: Oracle JDBC - DSN Connection
|
|
|