title: How to extract a hashmap object from jdbc template query
body: <p>I'm trying to extract 2 lists/arrays of Integers from a JDBCTemplate query.
  I assume retrieving a Map would be the most practical.
  The query is</p>
  
  <pre><code>Map&lt;Integer, Integer&gt; availabletime = jdbctemp.query("
  Select a.hour, 
      s.duration from appointment as a inner join services as s on a.service_fid=s.id 
  where date=? and guru_fid=? 
      ",date,guru_fid,//mapperlogic.class);
  </code></pre>
  
  <p>I need a.hour and s.duration as key value pairs of a hashmap. I'm a bit confused regarding the row mapper logic here. Ive mapped only to objects as of now like </p>
  
  <pre><code>public class RoleRowMapper implements RowMapper&lt;Role&gt; {
  
  @Override
  public Role mapRow(ResultSet row, int rowNum) throws SQLException {
      Role role=new Role();
      role.setId(row.getLong("id"));
      role.setName(row.getString("name"));
      return role;
  }
  </code></pre>
  
  <p>}
  ` Can someone help me with extracting query results to Maps or multiple lists??</p>