java baba java baba - 7 months ago 29
Java Question

how get length or size of Resultset in java

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)   
  size = rs.getRow();