java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application [duplicate]
java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3072)
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
java.sql.DriverManager.getConnection(DriverManager.java:579)
java.sql.DriverManager.getConnection(DriverManager.java:221)
business.studentDB.insertNewStudent(studentDB.java:53)
controller.registercontrol.doPost(registercontrol.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
How is this caused and how can I solve it?
Soluzione
So changing your exception handling uncovered your real problem, which seems to be:
The specified DSN contains an architecture mismatch between the Driver and Application
This basically tells that you have either 32-bit driver against 64-bit access or other way around. You need to find out which and use the correct one. More on this problem on this thread, for example.
Leaving the Connection open may not be committing the changes to the database. If the Connection is being shared and you can't close it commit() your changes explicitly.
ps.executeUpdate();
conn.commit();
EDIT: In light of the stack trace shared please make sure that your Java IDE, Microsoft Access and JVM or JDK are all of the same bit i.e. either 32 or 64 bit versions. But, yes adding the finally block is still recommended.