How do I use 64-bit Java ODBC driver with a Access database on Windows 2008?

15,164

Solution 1

Microsoft Access in Office 2010 will have a 64 bit version. Earlier versions of Microsoft Office are 32 bit only.

Using SQLExpress is both free and easy enough to use, and Access and Java can connect to it, so it seems like a good choice.

Since you said that was a last resort, the other option is to run the 32-bit JDK, which should run fine on Server 2008.

Solution 2

Have you tried launching the 32-bit ODBC manager from Windows 2008 - to see if that helps you diagnose the issue?

The 32-bit version of the Odbcad32.exe file is located in the %systemdrive%WindowsSysWoW64 folder

Solution 3

I had same problem. The cause was that i was using 64 Bit ODBC DSN with a 32 Bit JDK. These should be same architecture (both ODBC DSN and JDK need to be either 64 bits or 32 bits). If you would register ODBC DSN on 32 bits and calling from a 64 bit application (64 bit JVM) you would get an error that DSN source is not found (So for the application to see the ODBC source - the JVM you are running the app should be same architecture as ODBS DSN: both needs to be 64 bits, or both 32 bits). Hope this helps.

Solution 4

If you use Microsoft Office 2010, which will return into the 64 bit architecture. So, it will remove this error related to architecture mismatch between driver and the application.

Solution 5

I had the same problem and the solution, in my case, was to use a 32-bit JDK.

Share:
15,164
djangofan
Author by

djangofan

I always pay it forward. I ask questions so I can learn and I try to help others.

Updated on June 04, 2022

Comments

  • djangofan
    djangofan almost 2 years

    For years, on 32-bit systems I have never had a problem. Why can't I use 64-bit Java ODBC driver with a Access database on Windows Server 2008? Is the ODBC driver on a 64-bit system written in 32-bit code or something? Here is the error I see, using a 64-bit JDK1.6.018 :

    java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
            at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
            at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
            at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
            at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
            at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:185)
           .....
    

    I suspect that the Access driver is 32-bit because it doesn't show up in the 64-bit ODBC control panel for windows. Only two 64-bit drivers (for SQL Server) are visible in the "Drivers" tab of the ODBC control panel.

    So, what can I do? I would rather not have to use SQL Server and the JDBC Type-4 driver (but that would be my last resort).

  • djangofan
    djangofan about 14 years
    i believe there is a problem running the 32-bit JDK on a 64-bit machine. i suspect it has something to do with how the JVM uses .dlls to handle memory (RAM) management. i had trouble, when i tried, which is why im using the 64-bit jdk.
  • Yishai
    Yishai about 14 years
    @djangofan, the limitation will be in how much memory the JVM can use. Of course, if there are subtle issues, I wouldn't necessarily know.
  • David-W-Fenton
    David-W-Fenton about 14 years
    The beta of the 64-bit ACE is already downloadable and other people here on SO have said they have used it and had success.
  • djangofan
    djangofan about 13 years
    The latest non-beta 64-bit version of the Access driver, available for download after December 2010, seems to be more stable for me and works well (as long as I have my MS Office 2003 32-bit also installed on the system). The Access driver, by itself, without any MS Office installed, still gave me issues.
  • djangofan
    djangofan almost 12 years
    Yes, when I realized there are 2 ODBC control panels, then things started making sense.
  • djangofan
    djangofan almost 12 years
    32 bit JDK would work only if you had installed the 32-bit MS Office 2010. Also, in that case you generally need to use the odbccad32.exe control panel that is located in the SYSWOW64 directory. I say "generally" because there are some caveats.