This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JDBC and the fly likes Connecting to Database without a DSN Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connecting to Database without a DSN" Watch "Connecting to Database without a DSN" New topic

Connecting to Database without a DSN

Mahua Dutta

Joined: Sep 21, 2001
Posts: 1
How to connect to the database through a java application running in a client machine without a DSN. I mean can we access to a database in the server like we access through servlets.
I am using the following strings
String url = "jdbc racle:thin:@SERVER's IP ADDRESS:PORT:SERVICE_NAME";
con = DriverManager.getConnection(url, "mis", "mis");
But I am getting the following Exception
I am using same Strings and driver to access the database through servlets and its working properly.
Its very urgent. If any one can help me, Please.
Regards Mahua
[This message has been edited by Mahua Dutta (edited September 22, 2001).]
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
Try this instead of the ClassforName() technique:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
its from the Oracle docs.
Hope that helps,

Raising Flares debut album 'Ignition' out now

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
I agree. Here's the link:
subject: Connecting to Database without a DSN
Similar Threads
how dsn can be used on deployment server
Creating DSN
Please Help!
How to build DSN on the fly for MS Access database JDBC access?
Getting pooled connection using DSN