从 Java 类 (ocijdbc11.dll) 连接到 Oracle 数据库时出现问题
我有一些数据库导入和导出 ant 脚本,它们运行一些 Java 程序来导入和导出 Oracle 11g 数据。
这些脚本曾经在 Vista 32 位上运行,但在 Windows 7 64 位上停止运行。我可以使用两个版本的 ocijdbc11.dll。
当我使用 64 位版本时,错误消息为: java.lang.UnsatisfiedLinkError: C:\tools\oracle\ocijdbc11.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform。
当我使用32位版本时,错误消息是:java.lang.UnsatisfiedLinkError: C:\tools\oracle\ocijdbc11.dll: %1不是有效的Win32应用程序。
有谁知道我需要改变什么来解决这个问题?
I have some database import and export ant scripts that run little java programs to import and export data to and from oracle 11g.
The scripts used to work on Vista 32 bit, but stopped working with Windows 7 64 bit. There are two versions of ocijdbc11.dll that I can use.
When I use the 64bit version, the error message is: java.lang.UnsatisfiedLinkError: C:\tools\oracle\ocijdbc11.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform.
When I use the 32bit version, the error message is: java.lang.UnsatisfiedLinkError: C:\tools\oracle\ocijdbc11.dll: %1 is not a valid Win32 application.
Does anyone know what I would need to change to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,我不是 Windows 专家,但我也使用 Windows java 的 11g,但不是使用 oci 驱动程序,而是使用包含瘦驱动程序的 ojdbc14.jar。据我所知,这个驱动程序不需要本机 dll。
jar中的11不是oracle服务器版本,而是要使用的JDK版本。因此 ocijdbc11 是一个 JDK 1.1 兼容的驱动程序。您应该使用 ojdbc14.jar、ojdbc5.jar 或 ojdbc6.jar(ojdbc14.jar 也适用于 Java 6,但 ojdbc6.jar 不适用于 Java 1.4)。
Sorry, I'm not a windows guru, but I also use an 11g from windows java, but not with the oci driver, but the ojdbc14.jar which contains the thin driver. This driver does not need a native dll as I know.
The 11 in the jar is not the oracle server version, but the JDK version to be used with. So the ocijdbc11 is a JDK 1.1 compatible driver. You should use ojdbc14.jar, ojdbc5.jar or ojdbc6.jar (ojdbc14.jar also works with Java 6, but ojdbc6.jar not with Java 1.4).