Accessing Access over JDBC (using ODBC?)

I'm looking for a way to open an Access MDB file inside a Java App (using JDBC). A quick Google Search suggests that I need the JDBC-ODBC Bridge for this. Does this mean that I need to configure every system I want to run my app on to provide a ODBC DSN for the MDB I want to open? And one more question (since I've never used ODBC before): will the communication happen over some sort of a socket (in a client/server-style), or through method/function calls (like with an embeded Derby db)?

402k 96 96 gold badges 823 823 silver badges 774 774 bronze badges asked Sep 13, 2009 at 20:47 2,037 2 2 gold badges 15 15 silver badges 9 9 bronze badges

1 Answer 1

1) You won't need to configure every system with a SYSTEM or USER ODBC DSN to access the MDB you want. You can still provide all the information you need in your JDBC URL:

jdbc:odbc:Driver=;DBQ=c:/yourdb.mdb 

But keep in mind that the system will need to have the driver you are using installed.

2) The communication will happen the way your ODBC driver communicates. If it opens a socket to the server (the way an Oracle ODBC connection takes place) it will open a socket. If it uses library function calls, it will communicate through library function calls.

JDBC to ODBC communication uses JNI to communicate.