executeQueryForObject returned too many results.

java.sql.SQLException: Error: executeQueryForObject returned too many results.
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForObject(MappedStatement.java:124)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:518)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:493)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:110)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:86)
at com.cgj.dao.EmployeeDaoImpl.select(EmployeeDaoImpl.java:13)
at com.cgj.serice.ServiceImpl.selectEmployee(ServiceImpl.java:44)
at com.cgj.main.Testit.main(Testit.java:24)
Exception in thread "main" java.lang.NullPointerException
at com.cgj.main.Testit.main(Testit.java:25)



returned too many results说的是返回的值多于一个了,executeQueryForObject要求只返回一个值,看看你的这个查询是应该用executeQueryForList,还是本身的Sql有问题
posted @ 2013-06-29 15:18  珊娃子。  阅读(1331)  评论(0编辑  收藏  举报