File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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?
at oracle.sql.LnxLibThin.lnxnuc(
at oracle.sql.NUMBER.toInt(
at oracle.jdbc.dbaccess.DBConversion.NumberBytesToInt(
at oracle.jdbc.driver.OracleStatement.getIntValue( at oracle.jdbc.driver.OracleResultSetImpl.getInt(
at oracle.jdbc.driver.OracleResultSet.getInt(

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 ).
[ 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

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.
I agree. Here's the link:
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