Пример #1
0
 public int update(User user) {
   return this.jdbcTemplate.update(
       "update users set name = ?,"
           + " password = ?, level = ?, login = ?, recommend = ?"
           + " where id = ?",
       user.getName(),
       user.getPassword(),
       user.getLevel().intValue(),
       user.getLogin(),
       user.getRecommend(),
       user.getId());
 }
Пример #2
0
 public void add(final User user) {
   System.out.println(
       user.getId()
           + ","
           + user.getName()
           + ","
           + user.getPassword()
           + ","
           + user.getLevel().intValue()
           + ","
           + user.getLogin()
           + ","
           + user.getRecommend());
   this.jdbcTemplate.update(
       "insert into users(id, name, password, level, login, recommend) values(?, ?, ?, ?, ?, ?) ",
       user.getId(),
       user.getName(),
       user.getPassword(),
       user.getLevel().intValue(),
       user.getLogin(),
       user.getRecommend());
 }