tags:

views:

69

answers:

2

I am implementing an x64 application, connecting to Oracle.

What driver should I use, to make sure that it doesn't matter what client version the user has installed.

So, right now I'm building my versions with an x64 and x86 ODP.NET driver, but I'm worried that this won't work when the user has an older/newer version of the Oracle client (ODP.NET) installed.

Should I move over to OleDB or System.DataAccess drivers, to avoid this problem, or won't there be a problem at all?

PS: I was previously using the ODBC driver, but there are known bugs on x64 for this, so this is not an option.

+1  A: 

Oh the 'joys' of Oracle... Ok basically, I never bothered with x64 versions, I just compiled my programs for 32 bits exclusively, so if that's a hard requirement not everything may apply for you.

But how I got version agnostic was to simply not use any client-installed drivers; instead I deployed in my application directory both the libraries for Oracle Instant Client, and the ODP binaries; the ODP will use OCI (instant client) files if they are accessible. It was the easiest way out and I'm glad I solved it that easily, although the information for this wasn't exactly easily reachable.

With the current versions (at least they were current when I last built the application), 11g, the combination of ODP and OCI ensured compatibility with versions 9-11.

Now, granted, OCI is pretty big (the english-only version is smaller at 'only' 35-ish MB if memory serves), but I had to live with it (deployment wasn't a big problem for me). Besides I had another dependency on a library which was already 50-ish MB - most of it in XML serialization assemblies! Don't get me started...

Hope this helps!

Alex Paven
That's a good idea. I've used it once myself (but without ODP). It's a pity that, in Java, you just add ojdbc6.jar (which is 2 MByte) to connect to Oracle, and in C or C# you need a complex setup with 50+ MBytes of stuff. I don't see why Oracle can't for C/C# what they did for Java.
Codo
So ALL drivers towards Oracle are using the Oracle Client AND are version dependent? Isn't any driver using ODBC, besides the regular ODBC Driver (that doesn't work in x64)? Indeed, the joys of Oracle :s
Bertvan
A: 

I'm afraid this won't work. Whatever driver you use, the directly or indirectly use the native OCI.DLL within the same process. And in your case, it must be the 64 bit version. So your application won't work with the 32 bit OCI.DLL.

To work around this, you have two options:

  1. Write a separate 32 bit application responsible for accessing Oracle and somehow communicate with that application.

  2. Embed a 64 bit version of the Java VM and access Oracle via OJDBC (the only option independent of OCI.DLL).

But I guess, these aren't very realistic options.

Codo
Combining x64 and x86 is not a problem. I just want to know how to be client-version independent. So if the user decides to upgrade his Oracle Client, that my app won't break...
Bertvan