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 Exhausted Resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exhausted Resultset" Watch "Exhausted Resultset" New topic
Author

Exhausted Resultset

Vrushali Gore
Ranch Hand

Joined: Oct 17, 2005
Posts: 40
When i am trying to perform any operation on scrollable and updatable resultset I am getting SQLException saying resultset exhausted. When exactly this exception comes?

Do queries in batch updates are automatically committed even if setAutoCommit() is set to false. Do it won't be taking any effect on batch updates?
Vrushali Gore
Ranch Hand

Joined: Oct 17, 2005
Posts: 40
I am making use of Oracle and Type-IV driver.
Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
We get exhausted resultset when resultset contents are not current and/or resultset contains stale data
We need to explicitly commit the transaction for batch updates


SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
Vrushali Gore
Ranch Hand

Joined: Oct 17, 2005
Posts: 40
Thanks.

But when i am executing batch updates then even if i have not said commit() it is committing the changes to DB(Oracle) even if the setAutoCommit() is set to false.

I didnt get this how this is happening?

Thanks once again.
Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
Idieally it doesn insert into dabase but doesn't commit.In other words
If we run query on database we can see records but if we try to execute query from program we won't see them. (Dirty read)
Please recheck this scenario

And use executeBatch rather than execute method as execute method some hoe opens the resultset and we get some weied erros like too many open cursors or exhausted resultset etc etc
[ April 17, 2007: Message edited by: Gaurav Chikara ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exhausted Resultset