64 位 Java 无法通过 ODBC 访问 32 位 MS Access 数据库 [英] 64-bit Java can't access 32-bit MS Access database via ODBC

查看:26
本文介绍了64 位 Java 无法通过 ODBC 访问 32 位 MS Access 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台新的 64 位笔记本电脑,并安装了 STS 64 位和 Java 64 位.我正在尝试创建到 32 位 Microsoft 数据库的 ODBC 连接;但是默认的管理工具不提供访问驱动程序.谷歌搜索后,我看到有一个管理工具用于创建位于 C:WindowsSysWOW64odbcad32.exe 的 32 位驱动程序.但是,从它创建的 ODBC 连接给我一条错误消息,指示我运行程序时体系结构不匹配:

I've got a new 64-bit laptop and have installed STS 64-bit and Java 64-bit. I'm trying to create an ODBC connection to a 32-bi Microsoft database; however the default Admin tools don't provide a driver for access. After googling around, I saw that there's an admin tool for creating 32-bit drivers located in C:WindowsSysWOW64odbcad32.exe. However, an ODBC connection created from that that gives me an error message indicating an architecture mismatch when I run the program:

[Microsoft][ODBC 驱动程序管理器] 指定的 DSN 包含驱动程序和应用程序之间的体系结构不匹配"

"[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application"

我认为这是因为 64 位 Java 正在尝试使用 32 位驱动程序.为了解决这个问题,我尝试将参数-D32"放在 VM 参数中,但得到了相同的结果.

I think it's because the 64-bit Java is trying to use the 32-bit driver. To get around the problem, I tried to put the argument "-D32" in the VM arguments, but got the same result.

我正在考虑卸载 STS 和 Java 并用 32 位版本替换它们.有更好的解决方案吗?

I'm thinking of uninstalling STS and Java and replacing them with the 32 bit versions. Is there a better solution?

推荐答案

要加载 32 位本机库,您需要有 32 位 JVM.

To load a 32-bit native library you need to have a 32-bit JVM.

您无需卸载 Java,您可以安装任意多个版本.

You don't need to uninstall Java, you can have as many version installed as you like.

您可以使用 64 位 JVM 与加载驱动程序的 32 位 JVM 通信,但这可能比您需要的更复杂.

You can use your 64-bit JVM to talk to a 32-bit JVM which loads your driver, but this may be more complicated than you need.

这篇关于64 位 Java 无法通过 ODBC 访问 32 位 MS Access 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆