I am trying to perform an SQL query to see how many records there are in my table.
The SQL that I'm using for this is SELECT COUNT(*) FROM myTable;
The query is then being executed and stored in a ResultSet.
int recordNumber = 0;
String sqlString = "SELECT COUNT(*) FROM myTable;";
try {
ResultSet resultSet = stmt.executeQuery(sqlString);
resultSet.next();
recordNumber = Integer.parseInt(rst);
} catch (Exception e) {}
My questions is how do I get the number of records out of the ResultSet?