This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC/ODBC MS Access connection 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/ODBC MS Access connection" Watch "JDBC/ODBC MS Access connection" New topic

JDBC/ODBC MS Access connection

Carey Brown
Ranch Hand

Joined: Nov 19, 2001
Posts: 173

I've got MS Access and haven't been able to figure out how to set up a JDBC/ODBC bridge to connect to it. Is there something other than the JDKSE that I need to down load? What driver and connection code do I need to run?
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

I have this little program that I use when I want a quick "how to" jdbc lookup. This is the entire program that connects to an access database. The only thing you need to do is to install the jdk(1.3 is what I'm using) and the jvm. Here it is:

where "C:\\Temp\\data\\emp.mdb" is the path to the mdb(emp.mdb in this case) plus escape characters for the \ characters and "username"&"password" are the username and passwords that I set up in Access for security.
and no, you don't have to set up a DSN and all that hassle, this is a DSNless connection to access
Carey Brown
Ranch Hand

Joined: Nov 19, 2001
Posts: 173

A big THANKS. That was exactly what I needed. It worked great!
It is sorta covered in the JavaRanch Style Guide.
subject: JDBC/ODBC MS Access connection
Similar Threads
connection of JDBC with oracle 9i database
JDBC Connection to MS Access DB without ODBC
java.sql.SQLException: No suitable driver