示例#1
0
 public boolean addUser(User user) {
   boolean result =
       add(
           "INSERT INTO "
               + getTableName()
               + " VALUES('"
               + user.getLoginname()
               + "',"
               + "'"
               + user.getUsername()
               + "','"
               + user.getPassword()
               + "','"
               + user.getRepassword()
               + "',"
               + "'"
               + user.getAge()
               + "','"
               + user.getGender()
               + "','"
               + user.getID()
               + "',"
               + "'"
               + user.getAddress()
               + "','"
               + user.getTelephone()
               + "')");
   return result;
 }
示例#2
0
  public User isValidLogin(String email, String password) {
    userDAO.beginTransaction();
    User user = userDAO.findUserByEmail(email);

    if (user == null || !user.getPassword().equals(password)) {
      return null;
    }

    return user;
  }
示例#3
0
 public boolean updateUser(User user) {
   boolean result =
       update(
           "update "
               + getTableName()
               + " set PASSWORD = '******'"
               + "where LOGINNAME='"
               + user.getLoginname()
               + "'");
   return result;
 }