File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes JDBC without DSN Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC without DSN" Watch "JDBC without DSN" New topic

JDBC without DSN

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Is it possible to use JDBC w/o a DSN? Is it possible to use JDBC with the MS Access file directly?
- Manish
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
For an access file I dont think so. In order to do it DSNless then you'd need to have a different type of driver than an ODBC. I don't think there is one for Access. I know M$ just came out with one for SQL Server but I'm not positive about Access. You could go to google and try to do a search for a type 4 JDBC dirver with access as a keyword in the search statement.

Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Try this link (you can get a 30 days trial):

Regards, Rene Larsen
Dropbox Invite
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Manish Hatwalne:
Is it possible to use JDBC w/o a DSN? Is it possible to use JDBC with the MS Access file directly?
- Manish
There are workarounds. The one I use for MSAccess and the jdbcdbc bridge is this ( no configuration or DSN setup required ) :

*NOTE - this method is VERY finicky. All the spaces in the connection string MUST stay the same. Failure to do this will cause exceptions.
**NOTE - ODBC driver implementations of MSAccess may be different, and thus this may not work for your computer
***NOTE - as you can see from the previous 2 notes, this probably isn't a solution to something that will go into production...then again using MSAccess isn't either
I agree. Here's the link:
subject: JDBC without DSN
Similar Threads
How to use File DSN in JDBC
Connecting to a local (microsoft) database, best approach?
how i can connect sql with my application without creating DSN
What do I need to use Access with JDBC
jdbcodbc for mac os x