aspose file tools
The moose likes JDBC and the fly likes Oracle JDBC - DSN Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Oracle JDBC - DSN Connection" Watch "Oracle JDBC - DSN Connection" New topic
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("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

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?

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Oracle JDBC - DSN Connection
 
Similar Threads
How to get Username and password automatically
connecting to ms access database
DSN connection
servlet jdbc
jdbc:odbc with DSN less connection for MS Access