使用spring的jdbcTemplate做查询时遇到的问题。。。
String handlersql="select count(*) from d_handler where unitcode=? and handlercode=?";
int handlercount=jdbcTemplate.queryForInt(handlersql,logininfo.getUnitcode(),logininfo.getHandlercode());
表里是有一条上面对应的数据的,打印的sql也正常,但是就是 handlercount查出来是0,求高手解决。。。。。。。。
[最优解释]
String handlersql="select count(*) from d_handler where unitcode=? and handlercode=?";错了
改为:String handlersql="select count(h) from d_handler as h where unitcode=? and handlercode=?";
[其他解释]
先打印确定下 logininfo.getUnitcode(),logininfo.getHandlercode()) 是你期望的值不
[其他解释]