在嘗試建立到Access 2007數據庫的JDBC連接時出現錯誤。在連接到MS Access 2007時出錯提示
環境的詳細信息:Windows 7 64-bit, JRE 7 64-bit, Access 2007 32-bit
:
driver = "sun.jdbc.odbc.JdbcOdbcDriver";
url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="+database+";";
DriverManager.getConnection(url, dbusername, dbpassword);
我得到以下異常
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified