title: How to check ResultSet for emptiness inside Spring JDBC ResultSetExtractor?
body: <p>It seems that standard check of <code>ResultSet</code> emptiness will not work in Spring's JDBC <code>ResultSetExtractor</code>. I use it in following way:</p>
  
  <pre><code>    return jdbcTemplate.query(sql, ps -&gt; {
          ps.setLong(1, fooParam1);
          ps.setLong(2, fooParam2);
      }, rs -&gt; {
          return rs.getLong(1);
      });
  </code></pre>
  
  <p>So what is the correct way check <code>ResultSet</code> emptiness in such pattern?</p>