Previously I had provided the gist of how to access MS Access database from JDBC using JDBC-ODBC bridge. Today I will elaborate on that and provide you with two sample classes. The first - AccessJDBCUtil.java defines a method which provides you with a connection to the ms access database. The second - AccessJDBCTest.java uses the first to execute any given query (DDL & DML supported) on any ms access database and displays the result on console.

AccessJDBCUtil.java can be used as a utlity class for connecting to Access databases. The connection provides read/write access to the database. In other words you can execute queries as well as DDL supported by MS Access. It simplifies creation of the strange connection parameters.

The rest should be clearly explained by the self-explanatory code included below: