java baba java baba - 1 year ago 112
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

Answer Source

If you just want the number of rows in the ResultSet, you can do :

int size= 0;
if (rs != null)   
  size = rs.getRow();  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download