i got this error:
The specified DSN contains an architecture mismatch between the Driver and Application
while trying to conne
That message appears under the following circumstances:
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