views:

1010

answers:

2

Why the heck does Oracle offer a different(!) version of the JDBC driver, e.g. ojdbc14.jar, for every(!) database version?
The files all have different sizes and thus probably different content.

background:
We get a random and seemingly irreproducible error saying "invalid number" when saving data (we guess it's the Timestamp). But it's not any particular statement. Most of the time, it saves just fine. Just once a month a harmless looking statement will fail.

So i had a closer look at Oracle's download site and noticed that none of the filesizes match despite files sharing the same name.

Our product is run on databases maintained by our clients, i.e. whatever version and patch the clients have running is what it is.
So what driver do we use? The latest (Oracle 11g) - despite the fact that it's usually 9i and 10g databases?

Why don't they just link all versions to the same "one driver suits all" file?
Or are there minute differences leading to effects like our random errors?

EDIT: i was mistaken about the 9i databases.

+6  A: 

please see the compatibility matrix at http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#02_02

Also take in mind that the timestamp datatype is only available since Oracle 10.

Oliver Michels
These drivers "can talk to" just about any modern database version. So you're saying i just pick the newest release and keep my fingers crossed that it has all the bug fixes i need?... and i was wrong about the 9i's. We retired them last year.
Stroboskop
well, i doubt it is a bug in the jdbc driver. i would inspect the code for number casting bugs, "number to string", "string to date" and so on. Are we talking about ORA-01722, invalid number? If so, i would check the debugging logs and not care about driver version conflicts.
Oliver Michels
Yes, it's ORA-01722. We use PreparedStatements, meaning the type conversions are all done by the driver. And the same statement works fine 99.9% of the time. We of course looked at our code first, but there seems to be nothing out of the ordinary.
Stroboskop
A: 

When we upgraded our Oracle database from 8.1.7 to 10.2.0, I was able to use the same Oracle jdbc driver (ojdbc14.jar). So their jdbc driver supports quite a few versions at the same time. Of course it's possible that some of the drivers are buggy, but the plan is to support more versions at the same time.

asalamon74