executeQueryForObject returned too many results
澳门新葡京官网
澳门新葡京官网
当前位置 : 澳门新葡京官网 > 新葡京娱乐场

executeQueryForObject returned too many results

有一个SQL:

select coalescecount1,0 from table where searchDt=#searchDt#

ibatis Dao层是这么写的:

public Integer findCountString searchDt throws SQLException {
    return Integerthis.get.queryForObject"xxxxx",searchDt;
}

现在提示错误:

java.sql.SQLException: Error: executeQueryForObject returned too many results.
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObjectGeneralStatement.java:108
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObjectSqlMapExecutorDelegate.java:566
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObjectSqlMapExecutorDelegate.java:541
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObjectSqlMapSessionImpl.java:106
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObjectSqlMapClientImpl.java:83
    at com.boco.monitor.dao.xxxxDao.findCountxxxxDao.java:112
    at com.boco.monitor.service.xxxxService.xxxxAnalysisxxxxService.java:882
    at com.boco.monitor.task.Task.runTask.java:35
    at java.util.TimerThread.mainLoopTimer.java:555
    at java.util.TimerThread.runTimer.java:505

奇了怪了,这SQL打死也不能查出多条结果啊?

确认一下传入的参数searchDt名字和值有没有问题

  • 列表项目

提示已经很清楚了。queryForObject只需要1条记录,但实际返回了多条记录。

栏目列表

广告位

澳门新葡京官网