The Dark Side Of A Developer

Monday, March 14, 2005

How determine the number of rows in a Java ResultSet?

Well, last week, I see the following code for determinate how many rows had a Java Resultset:

int i;


well there is a better way to do this ... just we must use the attribute last() of a Resultset as follows:

int totalRows=0;


easy, no?

... yes, my Master!