How to connect to a Microsoft Access-based database in a Windows using JDBC code?
What syntax is to be written for Type-1 and Type-4 types of the drivers?
To connect Java with MS Access, you need a JDBC driver. I still don't think Microsoft do one do they! http://www.easysoft.com/applications/microsoft-access/jdbc-odbc.html
I recommend a cross-platform Access JDBC driver called UCanAccess. It works great and there are lots of examples on the site (to help the original poster.)
You can use JDBC-ODBC bridge by calling:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
Then you can use JDBC database URL in form:
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\Nwind.mdb
or if you configure your database in ODBC manager you can use its alias:
jdbc:odbc:northwind
JDBC/ODBC driver is a platform dependent and can be used only in Windows OS. Also, there are some platform independent JDBC drivers, for example: StelsMDB JDBC driver (http://www.csv-jdbc.com/stels_mdb_jdbc.htm)