Problems connecting to an Oracle database from Java classes (ocijdbc11.dll)

I have several import and export ant database scripts that run small java programs to import and export data in oracle 11g.

The scripts used to work with Vista are 32 bits, but stopped working with the 64-bit version of Windows 7. There are two versions of ocijdbc11.dll that I can use.

When I use the 64-bit version, I get the error message: java.lang.UnsatisfiedLinkError: C: \ tools \ oracle \ ocijdbc11.dll: Cannot load the 64-bit AMD .dll in 32-bit IA platform.

When I use the 32-bit version, this error message: java.lang.UnsatisfiedLinkError: C: \ tools \ oracle \ ocijdbc11.dll:% 1 is not a valid Win32 application.

Does anyone know what I need to change to fix this?

+3
source share
1 answer

Sorry, I'm not a window guru, but I also use 11g from a java window, but not with the oci driver, but ojdbc14.jar, which contains a thin driver. This driver does not need a native DLL, as I know.

11 in the bank is not the oracle server version, but the JDK version to use. Thus, ocijdbc11 is a JDK compatible driver. You should use ojdbc14.jar, ojdbc5.jar or ojdbc6.jar (ojdbc14.jar also works with Java 6, but ojdbc6.jar is not with Java 1.4).

+5
source

Source: https://habr.com/ru/post/1754604/


All Articles