File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Strange !! ArrayOutOfBoundsException in Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Strange !! ArrayOutOfBoundsException in" Watch "Strange !! ArrayOutOfBoundsException in" New topic

Strange !! ArrayOutOfBoundsException in

Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
I am trying to loop through a resultset in a usaual way by using while(
But its throwing an ArrayOutOfBounds Exeption on the second call to the (when the resultset had 2 rows).
A part of the stack trace of the exception is given below.
java.lang.ArrayIndexOutOfBoundsException at oracle.jdbc.ttc7.NonPlsqlTTCColumn.unmarshal( at oracle.jdbc.ttc7.NonPlsqlTTCDataSet.unmarshalRow( at oracle.jdbc.ttc7.TTIrxd.unmarshal( at oracle.jdbc.ttc7.TTC7Protocol.fetch( at oracle.jdbc.driver.OracleStatement.fetchNextColumns( at oracle.jdbc.driver.OracleInputStream.needBytes( at oracle.jdbc.driver.OracleInputStream.close( at oracle.jdbc.driver.OracleResultSetImpl.prepare_for_new_row( at at
Thanks in advance for any help.

Kaustubh. Mumbai, India.
kundi kx

Joined: Feb 03, 2003
Posts: 10
Could you quote the offending block of code?
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
this is that code,
System.out.println(" row no. "+ counter);
docID = rsDocs.getString(1);
status = rsDocs.getString(2);
docTypeCode = rsDocs.getString(3);
supplierDoc = rsDocs.getString(4);
partNum = rsDocs.getString(5);
recvDate = rsDocs.getString(6);
stickyNote = rsDocs.getString(7);
componentNum = rsDocs.getString(8);
strSerial = rsDocs.getString(9);
also i am getting an arrayoutof bounds exception on getString(7). Though the resultsetmetatdata is giving me a column count of 9 !!!
I cannot understand this..
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
I tried to debug the above code and then found out that the problem is not in the but when the driver is reading the "LONG" type of value returned by the PLSQL procedure.
Again the problem is that when I am returning the LONG column as the first in the select there is no error, but when I change the position of the LONG column in the select the exception starts occuring from that line. And again its ArrayOutOfBoundsException.
I agree. Here's the link:
subject: Strange !! ArrayOutOfBoundsException in
It's not a secret anymore!