• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Oracle JDBC - DSN Connection

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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("jdbc:odbc: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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
reply
    Bookmark Topic Watch Topic
  • New Topic