That message appears under the following circumstances:
- you have the Access Database Engine (a.k.a. "ACE") installed,
- you create an ODBC DSN for your database connection, and
- your Java code is running in a JVM (Java Virtual Machine) whose "bit-ness" is different than that of the installed version of ACE.
For example,
you could have the 32-bit version of ACE installed and be trying to connect from Java code running in a 64-bit JVM, or
you could have the 64-bit version of ACE installed and be trying to connect from Java code running in a 32-bit JVM.
If you really want to use the JDBC-ODBC Bridge then the solution is to either switch to the "other" version of ACE (i.e., switch from 32-bit to 64-bit or vice versa), or have your Java code run under a JVM with the same "bit-ness" as the installed version of ACE.
(Note that if you have Office installed then "switching to 64-bit ACE" really means "switching to 64-bit Office". You can't "mix and match" 32-bit and 64-bit Office components.)
However, now that the JDBC-ODBC Bridge has been removed from Java 8 you should consider using the UCanAccess JDBC driver instead. It is a pure Java implementation that does not use Access ODBC to manipulate the database, so it works under both 32-bit and 64-bit JVMs on all platforms that run Java (i.e., not just Windows). For more details, see
Manipulating an Access database from Java without ODBC
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…