title: Fetching single row result without iterating in loop from Mysql using Java
body: <p>I have a simple query that returns only count of rows.</p>
  
  <pre><code>select count(*) cnt from table
  </code></pre>
  
  <p>I can read it by iterating through resultset.</p>
  
  <p>like</p>
  
  <pre><code>while(rs.next()){
    int rowCount= rs.getInt(cnt);
  }
  </code></pre>
  
  <p>But is there any way,using which I can get count directly without looping.</p>