Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Oracle JDBC - DSN Connection

 
Arun Mariappan K
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.




 
Arun Mariappan K
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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("jdbcdbc: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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic