Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

resultset size

 
krishna prasad gunasekaran
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to find the resultset size.
 
Jon Hanks
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your trying to find the number of rows, which I think you are, you can use this:

 
v ray
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to find the resultset size in a seperate method, the above response would work. If the resultset is huge, then a call like that could be expensive?
Another option would be just to a have a simple count variable which is incremented by one for every iteration?
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the last() method of the ResultSet and then call the getRow() method of the ResultSet which will give you ResultSet size.

Only you ResultSet shouldn't be of the type TYPE_FORWARD_ONLY

Resultset.last() example
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic