Working with a ResultSet
<p>I am trying to get a count from a particular table in my derby database, but when I run the code I keep getting Invalid operation at current cursor position</p>

<pre><code>    public int getNumUsers(){
    ResultSet rs = null;
    int size = -1;
    try {
        stmt = conn.createStatement();
        rs = stmt.executeQuery("select count(*) from USERS");
        while(rs.next()){
            size = rs.getInt("COUNT");
        }
        stmt.close();
    } catch (SQLException sqe) {
        sqe.printStackTrace();
    }
    return size;
}
</code></pre>
