JDBC driver MS Access connection

后端 未结 9 1854
执念已碎
执念已碎 2020-12-09 06:10

I want connect my MS access file with Java GUI program,but I have problem with connection....

I have Windows 7 64b, and ms office 2007. When I opened the ODBC driver

相关标签:
9条回答
  • 2020-12-09 07:10

    The problem is that you should run on Java 32 bit try to install latest JDK and it will work

    I run it using JDK version "jdk-7u67-windows-i586.exe"

    0 讨论(0)
  • 2020-12-09 07:11

    Use UCanAccess JDBC Driver :

    Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
    Connection conn=DriverManager.getConnection("jdbc:ucanaccess://<mdb or accdb file path>",user, password); 
    for example: 
    Connection conn=DriverManager.getConnection("jdbc:ucanaccess://c:/pippo.mdb");
    

    So for your example it will be Connection conn=DriverManager.getConnection("jdbc:ucanaccess://"+path)

    0 讨论(0)
  • 2020-12-09 07:11

    I answered a similar question enter link description here a while back.

    Basically at that time:

    1. You could connect to Ms-Access from 32 bit java through the JDBC-ODBC bridge
    2. You could not connect to a 32 bit Odbc driver through the JDBC-ODBC from 64 bit java. There was a message telling you that you can only connect from a 32 bit programs
    3. While Microsoft does provide a 64 bit Ms-Access driver, it did not work with Java's 64 bit JDBC-ODBC driver.

    Since then there seems to be a new open-source Ms-Access JDBC Driver Ms-Access JDBC driver. I have no Idea how good it is.

    0 讨论(0)
提交回复
热议问题