Re: MySQL ResultSet - count rows?



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
.