Re: JDBC: Fast way to find the number of rows in a ResultSet?
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Wed, 23 May 2007 19:53:56 -0400
Philipp Taprogge wrote:
I think there is a slightly better way... it's still not elegant, but it
should work:
result.last();
int rowcount = result.getRow();
result.beforeFirst(); //to reset the resultset for later use.
To do that the ResultSet would likely need to be scrollable
and that will cause many JDBC drivers to read all data
into memory. So this solution works best with small data.
Arne
.
- Follow-Ups:
- Re: JDBC: Fast way to find the number of rows in a ResultSet?
- From: Philipp Taprogge
- Re: JDBC: Fast way to find the number of rows in a ResultSet?
- References:
- JDBC: Fast way to find the number of rows in a ResultSet?
- From: Ronald Fischer
- Re: JDBC: Fast way to find the number of rows in a ResultSet?
- From: Philipp Taprogge
- JDBC: Fast way to find the number of rows in a ResultSet?
- Prev by Date: Re: JDBC: Fast way to find the number of rows in a ResultSet?
- Next by Date: jdbc connection to MS access database
- Previous by thread: Re: JDBC: Fast way to find the number of rows in a ResultSet?
- Next by thread: Re: JDBC: Fast way to find the number of rows in a ResultSet?
- Index(es):
Relevant Pages
|
|