简体   繁体   English

32位访问和32位Java

[英]32 Bit Access and 32 Bit Java

I have 32 bit Java Installed with 32 Bit Netbeans (64 Bit Laptop) and have Office Access 2007 32 Bit. 我已经安装了32位Java和32位Netbeans(64位笔记本电脑),并具有Office Access 2007 32位。

I am getting a problem when I am trying to connect a database to my java project. 尝试将数据库连接到我的java项目时遇到问题。

java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified java.lang.NullPointerException java.sql.SQLException:[Microsoft] [ODBC驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序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 谢谢

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

  • Click on the Start Menu. 单击开始菜单。
  • Select Control Panel. 选择控制面板。
  • Select Administrative Tools and double click the Data Sources (ODBC) icon. 选择管理工具,然后双击数据源(ODBC)图标。
  • Click on the System DSN tab. 单击系统DSN选项卡。
  • Click the Add button. 单击添加按钮。
  • Select Microsoft Access Driver (*.mdb) from the drivers list and click the Finish button. 从驱动程序列表中选择Microsoft Access驱动程序(* .mdb),然后单击完成按钮。
  • Provide the mdb file... to database and provide name "Importer" 提供mdb文件...到数据库并提供名称“ Importer”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM