I am using JdbcTemplate
to retrieve a Bean from the db. Here is my method:
public List getTrackerData() {
return List
This is happening because, the queryForList method you have used will not support for multiple columns. See the implementation of queryForList from JdbcTemplate
public List More ...queryForList(String sql, Object[] args, Class elementType) throws DataAccessException
{
return query(sql, args, getSingleColumnRowMapper(elementType));
}
The getsingleColumnRowMapper() method creates a new RowMapper for reading result objects from a single column. You can use the method given below instead.
public List query(String sql, Object[] args, RowMapper rowMapper) throws DataAccessException
{
return query(sql, args, new RowMapperResultSetExtractor(rowMapper));
}