Version of Oracle thin driver to use with Java 6

Aravind Yarram picture Aravind Yarram · Nov 12, 2010 · Viewed 16.7k times · Source

We are upgrading from Java 1.5 to Java 6 and J2EE 1.4 to Java EE 5. We are using Oracle 10g. Java EE 5 only supports JDBC 3.0, but Java 6 supports JDBC 4.0. If I am running on a Java EE 5 server with Java 6, can I use the JDBC 4.0 API in my Java EE 5 web app?

Which Oracle thin driver should I use? Is it ojdbc6.jar from Oracle's download page? Is that compatible with Oracle 10g?

Answer

darioo picture darioo · Nov 12, 2010

You can use ojdbc6.jar.

There are 3 Oracle JDBC drivers still being widely used:

  • ojdbc14.jar for projects with JDK 1.4
  • ojdbc5.jar for projects with JDK 5 (or 1.5)
  • ojdbc6.jar for projects with JDK 6 (or 1.6)

Even though you're using Java EE 5, if the relevant JDK is 6, then you match Oracle driver's version number with your JDK number.

Oracle has a FAQ on their JDBC drivers regarding driver and database compatibility. This part might be useful to you.