Angsuman's Java Blog

News and views from my perspective as a Chief Software Architect and CEO. Focused on Java and Web Technologies.


Saturday, August 31, 2002

Do you know how to access MS Access DB from Java?

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String filename = args[0].replace('\\', '/');
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database += filename.trim() + ";DriverID=22;READONLY=true}";
Connection con = DriverManager.getConnection(database, "", "");