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 java.sql.SQLException: Exhausted Resultset 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 "java.sql.SQLException: Exhausted Resultset" Watch "java.sql.SQLException: Exhausted Resultset" New topic

java.sql.SQLException: Exhausted Resultset

Bharat Agarwal

Joined: Jun 16, 2001
Posts: 21
Hi, I am trying to insert and retreive an Bfile into an oracle database and i get the error as stated above. Can someone help me out please, what does that error means. I am sending the code hereby :

I add the ubb code tags for easier reading. -- Carl

[This message has been edited by Carl Trusiak (edited August 14, 2001).]
Bharat Agarwal

Joined: Jun 16, 2001
Posts: 21
The detailed error message is :
java.sql.SQLException: Exhausted Resultset
at java.lang.Throwable.fillInStackTrace(
at java.lang.Throwable.<init>(
at java.lang.Exception.<init>(
at java.sql.SQLException.<init>(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(
at oracle.jdbc.driver.OracleStatement.getStringValue(
at oracle.jdbc.driver.OracleResultSetImpl.getString(
at TestProject.action(
at java.awt.Component.handleEvent(
at java.awt.Component.postEvent(
at java.awt.Button.process(
at java.awt.ActionEvt.dispatch(
Parvinder Arora

Joined: Aug 14, 2001
Posts: 3
It must be because for the reason that when the resultset is used before that statement must have been closed
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
That exception will occur whenever you get one row returned. You need to change


Andd that should eliminate the error. If you had one row returned, when you did the System.out.println( ); the ResultSet was navigated to that row and printed out "true" Now when you did the while ( ! ), it navigated beyound the end of the ResultSet. returns false indicating that you are no longer within the rows but, since you did a ! you go ahead and try and access a null row. Hence the Exhausted Resultset Exception

Hope This Helps
Carl Trusiak, SCJP2

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Bharat Agarwal

Joined: Jun 16, 2001
Posts: 21
Thanx guys,
I did tried all this methods that you had advised before posting the question. I however got rid of that error but I am in the other error now.. I tried to make an binary file of all the pixel values and then try to insert that binary file into the BFILE column of the database. And when I try to read the name of the file entered, it gives some weird name as oracle.sql.bfile@anw34 something of this kind. Also, when I try to use the sql methods( .FileExists() or .FileOpen()), it says that the file of the directory doesnot exists for this operation.
Is this problem something that is related to the server setting. The server that I am working on is Linux Mandrake 7.2. i am able to insert all other type of datatype in the database, but when it comes of using of blob or Bfile, I am stuck as it gives me all kinds of error which I am not able to handle. If you guys or any one else have any suggestions, I would really appreciate. I am ready to send all the code, if that helps to answer my question....
Thanx a lot in advance....
I agree. Here's the link:
subject: java.sql.SQLException: Exhausted Resultset
jQuery in Action, 3rd edition