title: How to return multiple rows from result set in java?
body: <p>I have a query, which returns multiple rows to result set. now i need to return total rows in to the application which calling this function.</p>
  
  <p>I tried with this code:</p>
  
  <pre><code>  final PreparedStatement ps = con.prepareStatement(query);
  
          rs = ps.executeQuery();
  
          while (rs.next()) {
              result = rs.getInt(1);
          }
  </code></pre>
  
  <p>by this code i am able to return only one value.
   Now i want to return multiple rows</p>