title: getResultSet from Spring-JDBC
body: <p>I'm using Spring's support for JDBC. I'd like to use <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="noreferrer">JdbcTemplate</a> (or SimpleJdbcTemplate) to execute a query and obtain the result as an instance of ResultSet.</p>
  
  <p>The only way that I can see of achieving this is using:</p>
  
  <pre><code>String sql = "select * from....";
  SqlRowSet results = jdbcTemplate.queryForRowSet(sql);
  ((ResultSetWrappingSqlRowSet) results).getResultSet();
  </code></pre>
  
  <p>An obvious shortcoming of this approach is that it requires me to make an assumption (by casting) about the implementation type of SqlRowSet, but is there a better way?</p>
  
  <p><strong>Background info...</strong></p>
  
  <p>The reason I want to obtain the results as a ResultSet, rather than a collection of beans, is because the results will be passed straight to a Jasper report for display. In other words, the Java bean would be used for nothing other than temporarily storing each row in the ResultSet, and I'd like to avoid creating such a bean for every Jasper report if possible.</p>
  
  <p>Cheers, Don</p>