title: How do I return a list of objects from an sql query using JdbcTemplate?
body: <p>If my SQL is:</p>
  
  <pre><code>select id, name, age from my_table where id in (...)
  </code></pre>
  
  <p>(we want to pass in the <em>in</em> values as arguments).</p>
  
  <p>We have a our ID values</p>
  
  <pre><code> List&lt;Integer&gt; = new ArrayList&lt;Integer&gt;(Arrays.asList(111,222,333));
  </code></pre>
  
  <p>A person object</p>
  
  <pre><code>public class Person
  {
      private int id;
      private int age;
      private String name;
      //getters setters, constructors
  }
  </code></pre>
  
  <p>Now I want to use the jdbcTemplate to execute the SQL such that I get a <code>List&lt;Person&gt;</code> returned. </p>
  
  <p>I've already created a method that will convert the sql string into</p>
  
  <pre><code>select id, name, age from my_table where id in (?,?,?)
  </code></pre>
  
  <p>if that helps.</p>
  
  <p>Looking at the <a href="http://docs.spring.io/spring-framework/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html" rel="nofollow">JdbcTemplate javadoc</a> it looks like I'd want to use one of the <code>queryForList</code> methods. </p>