简体   繁体   English

带有MS Access的JDBC中的“驱动程序和应用程序之间的体系结构不匹配”

[英]An “architecture mismatch between the Driver and Application” in JDBC with MS Access

I've been trying to connect to a MS Access 2007 database through JDBC (JDK is 64-bit under Windows 7 64-bit) and I receive the following error: 我一直在尝试通过JDBC连接到MS Access 2007数据库(JDK在Windows 7 64位下为64位),并且收到以下错误消息:

java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application. java.sql.SQLException:[Microsoft] [ODBC驱动程序管理器]指定的DSN包含驱动程序和应用程序之间的体系结构不匹配。

I upgraded Access to 2010, I used odbcad32.exe in Windows\\SysWOW64 and downloaded/installed 32-bit Microsoft Access Database Engine 2010 Redistributable (couldn't install the 64-bit MS Access Database Engine 2010 because I currently have 32-bit Office products installed), but I get still the same error. 我将Access升级到2010,在Windows \\ SysWOW64中使用odbcad32.exe并下载/安装了32位Microsoft Access数据库引擎2010可再发行组件(由于我当前具有32位Office,因此无法安装64位MS Access数据库引擎2010产品已安装),但我仍然遇到相同的错误。

What can I do to overcome this error? 我该怎么做才能克服这个错误?

As I mention in my other answer here , you need to be running the Java application in a JVM (Java Virtual Machine) with the same "bitness" as the installed version of the Access Database Engine (aka "ACE"). 正如我在这里的其他答案中提到的那样,您需要在JVM(Java虚拟机)中以与所安装的Access数据库引擎版本(即“ ACE”)相同的“位数”运行Java应用程序。 Since you have the 32-bit version of ACE installed you will need to run the Java application in a 32-bit JVM. 由于您已安装32位版本的ACE,因此需要在32位JVM中运行Java应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM