title: What is the return type of a "count" query against MySQL using Java JDBC?
body: <pre class="lang-java prettyprint-override"><code>String query = "SELECT COUNT(*) AS count FROM table1";
  ResultSet rs = DBConnection.executeQuery(query);
  </code></pre>
  
  <p>The above code works fine; however:</p>
  
  <pre class="lang-java prettyprint-override"><code>long count = rs.getLong("count");
  </code></pre>
  
  <p>This wont work, it throws SQLException.  How should I get data from the <code>ResultSet</code>?</p>