title: Get Number of Rows returned by ResultSet in Java
body: <p>I have used a <code>ResultSet</code> that returns certain number of rows. My code is something like this:</p>
  
  <pre><code>ResultSet res = getData();
  if(!res.next())
  {
      System.out.println("No Data Found");
  }
  while(res.next())
  {
      // code to display the data in the table.
  }
  </code></pre>
  
  <p>Is there any method to check the number of rows returned by the <code>ResultSet</code>?  Or do I have to write my own?</p>