Need to find record count in a resultset returned by a SQL query | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos

Need to find record count in a resultset returned by a SQL query

M
Murali Katragadda Post on 19/11/2019

I need to find the record count in a resultset returned by a SQL query...I don't want to use SQL query like Select count(*) from table_name. I need java code like

 

stmt = con.createStatement();

rs = stmt.executeQuery(query);
//rs.last();
//counter = rs.getRow();
while(rs.next()) {
counter = rs.getInt(0);