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 Resultset Exhausted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Resultset Exhausted" Watch "Resultset Exhausted" New topic

Resultset Exhausted

Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Hi guys,

Was just wondering if anybody could suggest anything as I am getting a resultset Exhausted exception and my query returned 1 record when directly executed thru oracle client.

[ July 13, 2005: Message edited by: Rahul Juneja ]

Rahul Juneja
ThoughtClicks -
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32302

Try printing out the value of If it displays false, as I suspect it does, there are no [more] rows and you are calling rs.getLong() on an invalid row.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Thanks dude but i found the problem.
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Originally posted by Rahul Juneja:
Thanks dude but i found the problem.

And the problem was...

The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Actually, I was using a seperate thread for committing certain process and again trying to access the commited data from the main thread, so sometimes the thread used for committing data is not yet finished and the main thread tries to access that data.

Okay, If you can answer my this question as When we call commit on a transaction context which has lot of changes done and all are to be commited will the control be given to a seperate database thread automatically.

I agree. Here's the link:
subject: Resultset Exhausted
jQuery in Action, 3rd edition