Re: MySQL ResultSet - count rows?
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Mon, 10 Dec 2007 19:05:28 -0500
Dyreatnews@xxxxxxx wrote:
On the other hand; if you're using a scrollable result set, you can loop
over it to find the size,
You don't even need to loop.
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = stmt.executeQuery("SELECT * FROM T1");
rs.last();
int n = rs.getRow();
rs.first();
But I would never use that construct.
Arne
.
- Follow-Ups:
- Re: MySQL ResultSet - count rows?
- From: Lew
- Re: MySQL ResultSet - count rows?
- References:
- MySQL ResultSet - count rows?
- From: Christoph
- Re: MySQL ResultSet - count rows?
- From: Sabine Dinis Blochberger
- Re: MySQL ResultSet - count rows?
- From: Christoph
- Re: MySQL ResultSet - count rows?
- From: Dyreatnews
- MySQL ResultSet - count rows?
- Prev by Date: Re: MySQL ResultSet - count rows?
- Next by Date: Re: MySQL ResultSet - count rows?
- Previous by thread: Re: MySQL ResultSet - count rows?
- Next by thread: Re: MySQL ResultSet - count rows?
- Index(es):