• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid state for getResultSet

 
sumana ar
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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);
out.println(variable+"<BR>");
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 problem...am i missing out something...this problem is annoying me..any help is appreciated.
thanks
--sumana reddy.
 
Vasudevan Gopalan
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Sheriff
Posts: 36031
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you close the resultset, statement or connection before executing this code? Any one of those would explain the error you are getting.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!