原来:
public int getMatchCount(String username,String password){ String sql="select count(*) from user_db where username=? and password=?"; return jdbcTemplate.queryForInt(sql,new Object[]{username,password}); }
现在:
public int getMatchCount(String username,String password){ String sql="select count(*) from user_db where username=? and password=?"; return jdbcTemplate.queryForObject(sql,new Object[]{username,password},Integer.class); }
全部用queryForObject了(包括queryForLong)