Hello, I'm not sure if i can resolve your problem but i can tell how i connect to access in my
java application.
I have a java class called connector which connects to access like following:
public class connectionAccess {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
PreparedStatement pstmt = null;
static{
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException ex) {
System.out.println("Error cnfe: "+ ex.getMessage());
}
}
public void createDataBaseConnection() throws SQLException{
con = DriverManager.getConnection("jdbc:odbc:DBNameSpecifiedInControlPanel","","");
stmt = con.createStatement();
}
public void closeDataBaseConnection() {
try {
if (rs != null) rs.close();
if (stmt != null) stmt.close();
if (con != null) con.close();
} catch (SQLException ex) {
}
}
} then you can call the method createDataBaseConnection before you do your selects/updates/deletes and then the closeDataBaseConnection method.
In the control panel / odbc administrator you have to make System DSN to your access DB called
DBNameSpecifiedInControlPanel