Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've recently had to look into connecting to an Oracle 9i instance using the latest version of SQLDeveloper (20 as of the time of this writing). Unfortunately trying to connect to the 9i database resulted in SQLDeveloper failing the connection test - "Status : Failure -Test failed: java.lang.ArrayIndexOutOfBoundsException".
Capture4.PNG


This didn't look like a common database connectivity error so it was time to start looking at JDBC drivers. The About dialog box showed the path to the JDBC driver used under the jdbc.library property. I first wanted to check with version of JDBC drivers were used, so checked it via the Command Prompt. It looked like 19c drivers were in use.
 JDBC version
>jdk\jre\bin\java -jar jdbc\lib\ojdbc8.jar --version
Oracle 19.3.0.0.0 JDBC 4.2 compiled with javac 1.8.0_201 on Mon_Apr_20_03:46:07_PDT_2020

Capture.PNG




I downloaded the 12c drivers from Oracle to try first, thinking that a version lower would be OK. The jdbc8.jar file in SQLDeveloper was then replaced with the 12c driver and I ran the version check again...
 JDBC Version
>jdk\jre\bin\java -jar jdbc\lib\ojdbc8.jar --version
Oracle 12.2.0.1.0 JDBC 4.2 compiled with javac 1.8.0_91 on Tue_Dec_13_06:08:31_PST_2016


The 12c drivers were in place so I opened up SQLDeveloper again and tried to connect to the 9i instance. Unfortunately this failed with "Status : Failure -Test failed: oracle.jdbc.driver.OracleDriverExtension.getConnection(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;" but I decided to exit SQLDeveloper and open it again, then the connection worked...
Capture2.PNG


I also made sure that I was connected to the 9i instance with some SQL...
Capture3.PNG


At this point I decided to revert the changes (replacing 12c with 19c drivers). For some reason, the "OracleDriverExtension.getConnection" error came up, instead of the error I was expecting. This confirmed my suspicion that there's some sort of caching going on with SQLDeveloper, so it seems necessary to open/close it a couple of times after changing drivers.

This workaround lets you connect to an old Oracle 9i instance, and of course any new 19c features are going to be lost if you're connecting to more recent versions of the database.

-i


Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...