*
The moose likes JDBC and the fly likes DSN connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "DSN connection" Watch "DSN connection" New topic
Author

DSN connection

Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
so far, i'm connecting directly to oracle using jdbc driver and this is
my connection string which works just fine






now i have a DSN from an RDB and i was wondering how the connection string would be to connect to a DSN and how the driver connection string would also be

also, what driver should be used? would that need a jdbc-odbc driver?
thanks
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

The basic steps go like this
1) the first time Class.forName() is called it loads the class
2) when the class loads, it has a static block register itself with the DriverManager
3) When you pass a JDBC URL to the DriverManager, it asks each of the drivers it knows about if they can handle it, when one says 'yes', the DriverManager gets it to return a connection
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

also, what driver should be used? would that need a jdbc-odbc driver?
In general you want to avoid the jdbc-odbc bridge if you can. Microsoft machines have their own generic way of talking to databases called ODBC, and the bridge is a quick and easy way to tap into this. But it only works on windows machines (more or less ) and it isn't production-ready. Also, there is usually a nice type-4 driver available for many databases.
Bernard Sigmund Gustav
Ranch Hand

Joined: Dec 20, 2005
Posts: 170
what i originally wanted was to connect to oracle rdb from java but that proved too difficult for my knowledge and i don't have the time as of the moment to learn because i need to deploy my project. It still needed some configurations for OpenVMS and a SDK for OpenVMS alpha.

so what i did instead was to create a DSN in MSAccess for my oracle rdb schema and then have java connect to that dsn instead of directly to the rdb.so now, i don't know how to connect or what the connection string should be and what driver should be downloaded for that. i already have ojdbc14.jar but that worked for oracle dbms and not for a DSN or odbc.

thanks
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Continued (at great length) and resolved http://forum.java.sun.com/thread.jspa?threadID=724991&messageID=4180231
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DSN connection
 
Similar Threads
DSN less MS access Connection using JSP - help needed
ODBC and JDBC!!!
Problem in Configring the Database
Query about DSN and DSN less Connection??
ODBC, DNS, JDBC