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()) 是你期望的值不
------其他解决方案--------------------------------------------------------
原因呢?
------其他解决方案--------------------------------------------------------
是的。然后呢?
------其他解决方案--------------------------------------------------------
null