GeeCON Prague 2014*
The moose likes JDBC 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
Bookmark "java.sql.SQLException: Exhausted Resultset" Watch "java.sql.SQLException: Exhausted Resultset" New topic
Author

java.sql.SQLException: Exhausted Resultset

Bharat Agarwal
Greenhorn

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
Greenhorn

Joined: Jun 16, 2001
Posts: 21
The detailed error message is :
java.sql.SQLException: Exhausted Resultset
at java.lang.Throwable.fillInStackTrace(Throwable.java:native)
at java.lang.Throwable.<init>(Throwable.java:38)
at java.lang.Exception.<init>(Exception.java:24)
at java.sql.SQLException.<init>(SQLException.java:22)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:219)
at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:2289)
at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2434)
at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:285)
at TestProject.action(TestProject.java:393)
at java.awt.Component.handleEvent(Component.java:570)
at java.awt.Component.postEvent(Component.java:935)
at java.awt.Button.process(Button.java:205)
at java.awt.ActionEvt.dispatch(ActionEvt.java:16)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:39)
Parvinder Arora
Greenhorn

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
hth
~Parvinder
Carl Trusiak
Sheriff

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

to

Andd that should eliminate the error. If you had one row returned, when you did the System.out.println( result.next() ); the ResultSet was navigated to that row and printed out "true" Now when you did the while ( !result.next() ), it navigated beyound the end of the ResultSet. result.next() 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
Greenhorn

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....
Bharat.
 
GeeCON Prague 2014
 
subject: java.sql.SQLException: Exhausted Resultset