File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Exception while retrieving the result from resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exception while retrieving the result from resultset" Watch "Exception while retrieving the result from resultset" New topic
Author

Exception while retrieving the result from resultset

Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
My application is running on Websphere 5.0 and using Oracle 9.2.04.
Some time it gives following exception in one particular query while retrieving a particular field. But this exception is coming random(sometime after 2 days). If I run this query in SQLPlus, it runs fine.
Seeing the exception it appears this is a JDBC driver problem.
Could someone please give the way how to fix this?
=============================
java.lang.ArrayIndexOutOfBoundsException
at oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:5737)
at oracle.sql.NUMBER.toInt(NUMBER.java:412)
at oracle.jdbc.dbaccess.DBConversion.NumberBytesToInt(DBConversion.java:2959)
at oracle.jdbc.driver.OracleStatement.getIntValue(OracleStatement.java:4505)
java.la at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:536)
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1528)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getInt(WSJdbcResultSet.java:1347)


Sanjeev Kaushik
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

this isn't a JDBC error, those errors come in the form a java.sql.SQLException. This is a straight up java.lang.Exception, and seems as this one stems from you refering to an array index for an array in which the index you are referencing does not exist ( greater than the size of the array or less than 0 ).
Jamie
[ April 14, 2004: Message edited by: Jamie Robertson ]
Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
Thanks Jamie,
I understand that it is a java.lang Exception, but when I run this query in SQL plus it runs properly and the column where getInt is applied is also having proper number value.
Can this be related to data format, thats why it is not able to convert a value to Integer? If I replace getInt by getString, then also it fails. And sometime I have seen failed to convert UTF8 to UCS2.
My doubt goes on the data format. Please advise.
Mukesh Netedge
Greenhorn

Joined: Apr 17, 2004
Posts: 10
Yeh Sanjeev,
It might be possible that your column are not compatible with an ite value.
I'll suggest to try with long type or any other big numeric type.
Cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception while retrieving the result from resultset
 
Similar Threads
Using of Statement.setFetchSize
problem with stored procedure.......
Arraylist retrieval of objects
wants to configure next and previous buttons for database entry !
How to show the actual Exception occured during JSP Excution in Error Pages using JSP