Discussions
Categories
- 196.9K All Categories
- 2.2K Data
- 240 Big Data Appliance
- 1.9K Data Science
- 450.4K Databases
- 221.7K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 550 MySQL Community Space
- 478 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 546 SQLcl
- 4K SQL Developer Data Modeler
- 187.1K SQL & PL/SQL
- 21.3K SQL Developer
- 295.9K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.6K Development Tools
- 107 DevOps
- 3.1K QA/Testing
- 646K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 155 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 18 Java Essentials
- 160 Java 8 Questions
- 86K Java Programming
- 80 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 443 LiveLabs
- 38 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 171 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 232 Portuguese
Anyone able to use JDBC with Microsoft Access 64-bit Driver?

user5664922
Member Posts: 3
I am trying to move an application from 32 to 64 bit JVM. Two small and seldom used features require import/export to a Microsoft Access database. These features are required but their speed and efficiency are of little concern. A problem which has been well described in 2318875 on Dec 11, 2011 is stopping my progress.
Briefly, the problem is that iterating over a ResultSet can cause an "Invalid string or buffer length" error on a method to get (Int String Double) data from a field. The original poster found that whether this error happens seems to depend on alignment in the stack and cited a Microsoft forum thread about aligning buffers to 64 bit addresses. Another thread in the JDBC forum suggested retrieving strings before doubles.
I found that this allowed about 1000 rows to be processed before the error rather than failing on the first row. The problem is also avoided by stepping through the code in Eclipse. (Perhaps the stack alignment is affected in a beneficial way.)
I am running 64-bit Java(TM) SE Runtime Environment (build 1.6.0_32-b05) on 64-bit Windows 7 Professional SP1. Office 2010 64 bit is installed and updated as is accessdatabaseengine2010sp1-kb2460011-x64-fullfile-en-us (the Microsoft Access engine (ACE) for 64-bit).
I also coded my test program in Perl, using exactly the same MS driver and it works without a problem. This and the earlier thread leads me to believe that there is either some problem in Java JDBC or this MS buffer alignment requirement is not consistent with ODBC. I have tested with the latest 1.6 and 1.7 Java releases and the latest Microsoft driver ("Microsoft Access Driver (*.mdb, *.accdb)" Version 14.00.6015.1000).
I would greatly appreciate hearing from anyone who has been able to use JDBC with the Microsoft Access 64 bit driver or has spent significant effort and given up. Thanks.
Edited by: user5664922 on Mar 4, 2013 8:00 AM
Readability Improvements
Briefly, the problem is that iterating over a ResultSet can cause an "Invalid string or buffer length" error on a method to get (Int String Double) data from a field. The original poster found that whether this error happens seems to depend on alignment in the stack and cited a Microsoft forum thread about aligning buffers to 64 bit addresses. Another thread in the JDBC forum suggested retrieving strings before doubles.
I found that this allowed about 1000 rows to be processed before the error rather than failing on the first row. The problem is also avoided by stepping through the code in Eclipse. (Perhaps the stack alignment is affected in a beneficial way.)
I am running 64-bit Java(TM) SE Runtime Environment (build 1.6.0_32-b05) on 64-bit Windows 7 Professional SP1. Office 2010 64 bit is installed and updated as is accessdatabaseengine2010sp1-kb2460011-x64-fullfile-en-us (the Microsoft Access engine (ACE) for 64-bit).
I also coded my test program in Perl, using exactly the same MS driver and it works without a problem. This and the earlier thread leads me to believe that there is either some problem in Java JDBC or this MS buffer alignment requirement is not consistent with ODBC. I have tested with the latest 1.6 and 1.7 Java releases and the latest Microsoft driver ("Microsoft Access Driver (*.mdb, *.accdb)" Version 14.00.6015.1000).
I would greatly appreciate hearing from anyone who has been able to use JDBC with the Microsoft Access 64 bit driver or has spent significant effort and given up. Thanks.
Edited by: user5664922 on Mar 4, 2013 8:00 AM
Readability Improvements
Tagged:
Answers
-
What a wall of text. Ever thought about adding some spacing to make it easier on the reader? Help people help you and all that... I can only say what I'd do: not run the 64 bits runtime in this case. A 32 bits runtime works just fine in a 64 bits environment, unless you need huge amounts of memory (which is not likely when you have to use limited tools like Access).
I have another bit of news on that front btw: the ODBC-JDBC bridge is going to be dropped from Java 8.
https://blogs.oracle.com/Lance/entry/removal_of_the_jdbc_odbc
So support for plorking around with Access in this manner is going to be dropped from core Java even. Its too big a hint to ignore. -
Thank you for enduring my massive paragraph (I have now edited) and the news of ODBC-JDBC bridge being removed a V8. That is helpful to know. The product I am working on will be replaced in a few years, so any info on the original question will still be appreciated from anyone who has had to deal with this.
-
There is a commercial Access driver which is written entirely in java. That might work for you.
This discussion has been closed.