I need to connect an odbc database to my java code. I know that for connecting mdb database I need to use this code but it doesn't work:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// set this to a MS Access DB you have on your machine
String filename = "C:/porogram/pro.mdb";
String database = "jdbc:odbc:Driver={Microsoft Access Driver(*.mdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
// now we can get the connection from the DriverManager
Connection con = DriverManager.getConnection( database ,"","");
Statement s = con.createStatement();
Thank you very much.