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

Exhausted Resultset

mohana konakanchi
Ranch Hand

Joined: May 16, 2001
Posts: 67
I am facing a problem while fetching data from ORACLE 8.06 database from a java class. I am using an oracle thin JDBC driver.
I repeatedly get an "Exhausted Resultset: prepare_for_new_get" error message.
I get this though I have taken care to close the result set only after fetching all the data.

while( {
// Fetch data into vector;

The error is not consistant because with the same query which produced this error message I sometimes get the correct results too.

Any help in this appreciated.
Beksy Kurian
Ranch Hand

Joined: Jul 11, 2001
Posts: 254
It means the Oracle result set you are using is closed.
For example, it will happen if you issue a query then close the
Statement before using the ResultSet. Open a
new statement before each request, then close it after use.
the following is from oracle technet site:
What does "Exhausted Resultset: prepare_for_new_get" means?
This error happens if you try to use a ResultSet after you close it. It also happens if you close the statement that created the ResultSet.
ResultSet rset = stmt.executeQuery ("select ROWID from EMP");
rset.close (); // or stmt.close ();
rset.getString (1);
mohana konakanchi
Ranch Hand

Joined: May 16, 2001
Posts: 67
Thank you.
I agree. Here's the link:
subject: Exhausted Resultset
It's not a secret anymore!