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

total records in a result set

 
ali farid
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get the total no. of records present in a resultset?
and is there any limit on the number of records in a resultset?
 
David Freels
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use ResultSet.last() which will move to the last row and then use ResultSet.getRow() which will return the row number (number of rows). This is available in JDBC 2.0 and above, and this cannot be a FORWARD_ONLY cursor.
Hope this helps.
David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic