1

I have 32 bit Java Installed with 32 Bit Netbeans (64 Bit Laptop) and have Office Access 2007 32 Bit.

I am getting a problem when I am trying to connect a database to my java project.

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified java.lang.NullPointerException

        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        String SourceURL = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb,*.accdb)};DBQ=" 
                + new File("Argos.accdb").getAbsolutePath() + ";";
        //MAY CHANGE THE ADMIN PART (Remove Admin)

        Argos = DriverManager.getConnection(SourceURL, "admin","");

Thanks

4

1 回答 1

1

来自http://www.stoneedge.com/help/OM_DOC/tips_tricks/Creating_ODBC_Connection_in_Windows.html

  • 单击开始菜单。
  • 选择控制面板。
  • 选择管理工具并双击数据源 (ODBC) 图标。
  • 单击系统 DSN 选项卡。
  • 单击添加按钮。
  • 从驱动程序列表中选择 Microsoft Access Driver (*.mdb),然后单击完成按钮。
  • 将 mdb 文件...提供给数据库并提供名称“Importer”
于 2013-03-28T18:32:55.440 回答