示例#1
0
  public static int updateOneUser(User user) {
    int uid = user.getUid();
    String userName = user.getUserName();
    String email = user.getEmail();
    String password = user.getPassword();
    try {
      conn = RDSManagement.getConnection();
      st = (Statement) conn.createStatement();
      String sql =
          "update User set email ='"
              + email
              + "', password ='******' where uid = "
              + uid
              + ";";
      System.out.println(sql);
      st.executeUpdate(sql);
      System.out.println("Update user: " + uid);

    } catch (SQLException e) {
      System.out.println(e.getMessage());
    } catch (Exception e) {
      System.out.println(e.getMessage());
    } finally {
      try {
        st.close();
        conn.close();
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
    return uid;
  }
 public UserTree(User user) {
   this.setUid(user.getUid());
   this.setUsername(user.getUsername());
   this.setPassword(user.getPassword());
   this.setIsadmin(user.isIsadmin());
   this.setEmployeename(user.getEmployeename());
   this.setUsertype(user.getUsertype());
   this.setUsertypename(user.getUsertypename());
   this.setEmail(user.getEmail());
   this.setComment(user.getComment());
   this.setCreateby(user.getCreateby());
   this.setCreatetime(user.getCreatetime());
   this.setEditby(user.getEditby());
   this.setEdittime(user.getEdittime());
   this.setLastlogin(user.getLastlogin());
   this.setSex(user.getSex());
   this.setBirthday(user.getBirthday());
   this.setIdcard(user.getIdcard());
   this.setAddress(user.getAddress());
   this.setMobile(user.getMobile());
   this.setTelephone(user.getTelephone());
   this.setEmergencycontact(user.getEmergencycontact());
   this.setAvatarurl(user.getAvatarurl());
   this.setPostuid(user.getPostuid());
   this.setPostname(user.getPostname());
   this.setParentuid(user.getParentuid());
 }