Como obter dados do mapa usando JDBCTemplate.queryForMap
Como carregar dados deJDBCTemplate.queryForMap()
e ele retorna a Interface do Mapa. Como mantemos os dados da consulta internamente no mapa. Estou tentando carregar, mas recebi uma exceção abaixo, ou seja,org.springframework.dao.IncorrectResultSizeDataAccessException: Resultado incorreto
Código:-
<code>public List getUserInfoByAlll() { List profilelist=new ArrayList(); Map m=new HashMap(); m=this.jdbctemplate.queryForMap("SELECT userid,username FROM USER"); Set s=m.keySet(); Iterator it=s.iterator(); while(it.hasNext()){ String its=(String)it.next(); Object ob=(Object)m.get(its); log.info("UserDAOImpl::getUserListSize()"+ob); } return profilelist; } </code>
Plz me ajude