Exploring the Account Class
Account Class Overview
The AccountHBankDataAccesscustomerNumbersortcodeaccountNumbertypeinterestRateopenedoverdraftLimitlastStatementnextStatementavailableBalanceactualBalance
Constants and SQL Queries
The class defines several constants for SQL queries and account attributes, such as GET_ACCOUNTGET_ACCOUNTSACCOUNT_NUMBERACCOUNT_TYPE
Methods for Account Operations
The AccountcreateAccountupdateAccountgetAccount
Example: Updating Account Information
The updateThisAccount
The updateThisAccountAccount
public void updateThis()
{
openConnection();
String sql = "UPDATE ACCOUNT SET ACCOUNT_TYPE = ? ,ACCOUNT_INTEREST_RATE = ? ,ACCOUNT_OVERDRAFT_LIMIT = ? ,ACCOUNT_LAST_STATEMENT = ? ,ACCOUNT_NEXT_STATEMENT = ? ,ACCOUNT_AVAILABLE_BALANCE = ? ,ACCOUNT_ACTUAL_BALANCE = ? WHERE ACCOUNT_NUMBER like ? AND ACCOUNT_SORTCODE like ?";
try (PreparedStatement stmt = conn.prepareStatement(sql);)
{
stmt.setString(1, this.type);
stmt.setDouble(2, this.interestRate);
stmt.setInt(3, this.overdraftLimit);
stmt.setString(4, this.lastStatement.toString());
stmt.setString(5, this.nextStatement.toString());
stmt.setDouble(6, this.availableBalance);
stmt.setDouble(7, this.actualBalance);
stmt.setString(8, this.accountNumber);
stmt.setString(9, this.sortcode);
stmt.executeUpdate();
}
catch (SQLException e)
{
logger.severe(e.toString());
This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human