How to convert ResultSet into a useful integer?
<p>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 <code>SELECT COUNT(*) FROM myTable;</code>
The query is then being executed and stored in a <code>ResultSet</code>.</p>

<pre><code>int recordNumber = 0;
    String sqlString = "SELECT COUNT(*) FROM myTable;";
    try {
        ResultSet resultSet = stmt.executeQuery(sqlString);
        resultSet.next();
        recordNumber = Integer.parseInt(rst);
    } catch (Exception e) {}
</code></pre>

<p>My questions is how do I get the number of records out of the <code>ResultSet</code>?</p>