I want to know how many rows in result set after executing the particular query
ResultSet rs = ps.executeQuery();
how get the size of rs??? thanx in advance
If you just want the number of rows in the ResultSet, you can do :
int size= 0;
if (rs != null)
{
rs.beforeFirst();
rs.last();
size = rs.getRow();
}
by doing while loop:
int size=0;
while (rs.next()) {
size++;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With