It appears that the problem was due to using the wrong release of Oracle's
JDBC thin drivers. I am trying to connect to an Oracle8 RDMS. If I compile the above code with java1.5, I thought I should use Oracle's ojdbc5.jar for the drivers, as Oracle says these are the drivers corresponding to java1.5. So that's what I did.
I returned to the Readme.txt that was included in my download for ojdbc5.jar. It said that the package oracle.jdbc.driver has been removed in JDBC 11R1 (which is ojdbc5.jar). If you note above, I was using this package in the statement which loaded the driver:
According to Readme.txt, I should be able to fix the problem by replacing oracle.jdbc.driver with oracle.jdbc. I tried the following code:
However I still got ArrayIndexOutOfBoundsException: 4. I then tried using the DataSource method for opening a connection:
However, this threw an ORA-12514 exception saying that the listener didn't know the requested service. In the event that I was doing something syntactically wrong, I tried using ods.setServerName, ods.setPortNumber, and ods.setDatabaseName, but this time I got an exception saying that Oracle didn't know how to make the URL.
I am not sure if it is even possible to use ojdbc5.jar with oracle8, or whether I am making some error in my code. However if I use the originally posted code and instead use classes12.zip or classes111.zip, everything works fine. So for the time being I am going back to these earlier releases of Oracle's JDBC drivers.
[ March 05, 2008: Message edited by: deb platt ]