• Post Reply Bookmark Topic Watch Topic
  • New Topic

Determine Rows in a ResultSet?

 
Amond Adams
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Dudes,
Lets say stmt.setFetchSize(100) is executed and then ResultSet forms as a reult of a executeQuery() not if the query only returned 10 or 20 rows, whats the cleanist way to determine the actual number of rows present in the ResultSet at any valid instance.
Love and Peace.
 
Rani Mukherjee
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amond,
I asked similar quest & found answer in same forum. You can view this at http://www.javaranch.com/ubb/Forum3/HTML/000494.html
Rani
 
Bhupinder Dhillon
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could create a scrollable result set and jump to the last row and call getRow() method which returns the number of the current row (in this case last row).
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!