This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Invalid state for getResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Invalid state for getResultSet" Watch "Invalid state for getResultSet" New topic

Invalid state for getResultSet

sumana ar

Joined: Aug 06, 2003
Posts: 28
i've a jsp page where in i pass queries to the bean and get back vectors. i retrieve the info from the vector as follows..res is the name of the vector.
int i = 0;
while(i < res.size()) {
variable = res.elementAt(i);
i = i+1;
i used the same logic in other jsp, which worked fine. but in this page it shows an oracle error 'Invalid state for getResultSet'. when i refresh the jsp page, then every thing works fine... but what could be the i missing out something...this problem is annoying me..any help is appreciated.
--sumana reddy.
Vasudevan Gopalan
Ranch Hand

Joined: Aug 29, 2003
Posts: 67
I think it is better to use enumeration instead of while loop.

If still not getting any record check the size of the vector.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30136

Did you close the resultset, statement or connection before executing this code? Any one of those would explain the error you are getting.

[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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Invalid state for getResultSet
Similar Threads
s:iterator tag in jsp page
Vector with bean:write tag
Vector object in HttpServletRequest
you have got to solve this ...its intersting
Struts: ActionForm does not contain user data