title: Spring batch - use JdbcCursorItemReader to read from a DataSource and work with the ResultSet
body: <p>I'm trying to use Spring Batch to create a Job that uses a DataSource (configure before) and runs a query. 
  I want to be able to iterate through the returned ResultSet to create a new table with the returned data.</p>
  
  <p>I can create a reader like this, but i don´t know how to iterate the results.</p>
  
  <pre><code>@Bean
  public JdbcCursorItemReader&lt;ResultSet&gt; reader(String query, DataSource dataSource) {
      JdbcCursorItemReader&lt;ResultSet&gt; itemReader = new JdbcCursorItemReader&lt;&gt;();
      itemReader.setDataSource(dataSource);
      itemReader.setSql(query);
      return itemReader;
  }
  </code></pre>
  
  <p>What should my ItemProcessor receive? This?</p>
  
  <pre><code>public class ExtractionItemProcessor implements ItemProcessor&lt;ResultSet, String&gt;{    
  @Override
      public String process(ResultSet item) throws Exception {
          // transform the resultSet into a SQL INSERT
    }
  }
  </code></pre>
  
  <p>EDIT: the only way I know the results of the query is by the ResultSet Metadata, so I can´t create a POJO and set the properties. </p>