我正在尝试将 Java 应用程序与 MS Access 2007 连接连接功能是:
import java.sql.*;
import javax.swing.JOptionPane;
public class ConnectAccess {
static Connection conn=null;
public static Connection connectDB(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:history");
JOptionPane.showMessageDialog(null, "Connection Established");
return conn;
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
return null;
}
}
}
但我收到此错误消息:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DNS contains a architecture mismatch between Driver and Application
操作系统是 Windows 8 64 位