use of SQLDatabase.SQLDatabaseEntities.CustomersTable in project SmartCity-Market by TechnionYP5777.
the class SQLDatabaseConnection method setPasswordCustomer.
@Override
public void setPasswordCustomer(String username, String newPassword) throws CriticalError, ClientNotExist {
log.debug("SQL Public setPasswordCustomer: Customer: " + username + " sets password.");
if (!isCustomerExist(username)) {
log.debug("SQL Public setPasswordCustomer: no such customer with username: " + username);
throw new ClientNotExist();
}
try {
// START transaction
connectionStartTransaction();
//Write part of transaction
//updating password
assignPasswordToRegisteredClient(new CustomersTable(), username, newPassword);
log.debug("SQL Public setPasswordCustomer: Success setting password for username: " + username);
// END transaction
connectionCommitTransaction();
} catch (SQLDatabaseException e) {
connectionRollbackTransaction();
throw e;
} finally {
connectionEndTransaction();
}
}
Aggregations