public void updateLoginInfo(User user) { String sqlStr = "update t_user set last_visit=?,credits=? where user_id=?"; jdbcTemplate.update( sqlStr, new Object[] {user.getLastIp(), user.getCredits(), user.getUserid()}); }