*
The moose likes JDBC and the fly likes Determine Rows in a ResultSet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Determine Rows in a ResultSet?" Watch "Determine Rows in a ResultSet?" New topic
Author

Determine Rows in a ResultSet?

Amond Adams
Ranch Hand

Joined: Nov 28, 2000
Posts: 62
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

Joined: Jan 14, 2001
Posts: 24
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

Joined: Oct 12, 2000
Posts: 124
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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Determine Rows in a ResultSet?