Wednesday, 17 March 2010

Oracle Old Driver Vs New Driver

exception:code:java.lang.ArrayIndexOutOfBoundsException: 4at oracle.jdbc.driver.T4C8TTIdty.marshal(T4C8TTIdty.java:465)at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:329)at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:490)at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:202)at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)at

Recently while trying to work with an oracle database I came across this wierd error. Thanks to some help which I recieved from forums. I was able to get rid of this problem

This problem occurs when you are working with a new version of JDK with an older version of Oracle.

Its often good practice to check the compatibility tables for JDK , Oracle database and driver versions before trying to code.

In my case I was using ojdbc6.jar which is the latest an compatible for oracle 11g as well and works well with JDK 6. However the database I was trying to connect to was Oracle 8.1.7.

Hence this wierd error.

To solve the problem I simply added an older version driver namely classes12.jar.

Other thing to note is there is a significant difference in the package name for the OracleDriver class.

In order to find the current version of oracle you are running we can use:

select * from product_component_version

No comments:

Post a Comment