Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ojdbc14.jar vs. ojdbc6.jar

Tags:

java

oracle

jdbc

I noticed the following difference but did not see it documented anywhere. I'm wondering if others have noticed the same thing or can point me to some documentations that proves the same.

Env:-

Oracle 11g, JDK 1.6, iBatis, PL/SQL

Scenario:-

ojdbc14.jar: if pl/sql returns a variable of type DATE and I try to put that in a java.sql.Date variable then everything works fine. Example:

Date annualDate = (Date) map.get("exam_date");

ojdbc6.jar: if pl/sql returns a variable of type DATE and I try to put that in a java.sql.Date variable then I get an exception:

java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date 
like image 424
Omnipresent Avatar asked Jul 09 '10 03:07

Omnipresent


People also ask

What is ojdbc14 jar?

ojdbc14/ojdbc14.jar.zip( 1,454 k) The download jar file contains the following class files or Java source files.

What is the difference between ojdbc6 and ojdbc7?

Note that another difference between ojdbc6 and ojdbc7 is the supported Oracle version. Specifically ojdbc7 does not support Oracle 11.2 or 11gR2 whereas ojdbc6 does: source. Show activity on this post. For completeness, note that the number in the filename is NOT the version number of the driver and ojdbc6.

What is the difference between ojdbc8 and OJDBC10?

OJDBC10 is compiled with Java 10 and will not work unless you're running Bamboo 8 with Java 11. OJDBC8 is compiled with Java 8 and recommended by Oracle even if using Java 11: If you are using JDK11 then, ojdbc8. jar is still a better choice as it includes all the 4.3 features but as Oracle extensions.


2 Answers

The "14" and "6" in those driver names refer to the JVM they were written for. If you're still using JDK 1.4 I'd say you have a serious problem and need to upgrade. JDK 1.4 is long past its useful support life. It didn't even have generics! JDK 6 u21 is the current production standard from Oracle/Sun. I'd recommend switching to it if you haven't already.

like image 83
duffymo Avatar answered Sep 23 '22 03:09

duffymo


Actually, ojdbc14.jar doesn't really say anything about the real version of the driver (see JDBC Driver Downloads), except that it predates Oracle 11g. In such situation, you should provide the exact version.

Anyway, I think you'll find some explanation in What is going on with DATE and TIMESTAMP? In short, they changed the behavior in 9.2 drivers and then again in 11.1 drivers.

This might explain the differences you're experiencing (and I suggest using the most recent version i.e. the 11.2 drivers).

like image 34
Pascal Thivent Avatar answered Sep 22 '22 03:09

Pascal Thivent