Put SQL result into a map
Posted in IT Stuff
To extract two or more object (in this sample two Integer) from a DB and putting into a map, use this: final Map<Integer,Integer> topic = new HashMap<Integer,Integer>(); getJdbcTemplate().query(sqlCommand, new Object[] {query_parameter}, new RowMapper<Object>(){ public Object mapRow(ResultSet rs, int arg1) throws SQLException { topic.put(rs.getInt("integer1"), rs.getInt("integer2")); return null; } });final Map<Integer,Integer> topic = new HashMap<Integer,Integer>(); getJdbcTemplate().query(sqlCommand,….