Exemplo n.º 1
0
  @Override
  public void insertRegistry(UserAccount account) throws java.sql.SQLException {
    String query =
        "INSERT INTO user VALUES "
            + "(NULL,'"
            + account.getName()
            + "','"
            + account.getLogin()
            + "','"
            + account.getPassword()
            + "','"
            + account.getEmail()
            + "');";

    MySql.stm.executeUpdate(query);
  }
Exemplo n.º 2
0
  @Override
  public void alterRegistry(UserAccount account) throws java.sql.SQLException {

    String query =
        "UPDATE user SET name =\" "
            + account.getName()
            + "\",login = \""
            + account.getLogin()
            + "\",password =\""
            + account.getPassword()
            + "\", email = \""
            + account.getEmail()
            + "\"WHERE iduser = "******";";

    MySql.stm.executeUpdate(query);
  }