This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

isLast() and last() methods behavior?

 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
I'm trying to use ResultSet,when i call last() or isLast()
i do not get any response,what i think at least i should get tru or false ,or what i want which is i need to move the curser to last row,these for example,but i tried also different methods too and i did not get the right return type from them.
any help will be appreciated.
Thanks
 
John Bateman
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
You should post some code here and any error messages you are getting. When you execute last() and isLast() on a ResultSet you should get true or false as a return type.
Thanks.
 
Gils Roy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Toms Barns
I just come to have the same problem. I resolve it of this manner.
ResultSet rset=.......
boolean rset_hasData=rset.next();
while (rset_hasData){
String debut=rset.getString(1);
String fin=rset.getString(2);
rset_hasData=rset.next();
}
After the while, the cursor is moved to last row and I capture the contents of the two first fields of the request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic