ResultSet rs = stmt.executeQuery("select count(*) from Student");
rs.last();
//Moving the cursor to the last row
System.out.println("Table contains "+rs.getRow()+" rows");
rs.beforeFirst();                       //back to initial state

Post a Comment

Previous Post Next Post