There is no direct method in JDBC. In JDBC 1.0, the only way available is using while loop with a counter as follows. 1 2 3 4 5 6 7 8 ResultSet res = stmt.executeQuery("select * from Employee"); int counter = 0; while(res.next()) { counter++; } System.out.println("Number of records in ResultSet: " + counter); […]
↧