Exploring the Account Class
Account Class Overview
The Account
HBankDataAccess
customerNumber
sortcode
accountNumber
type
interestRate
opened
overdraftLimit
lastStatement
nextStatement
availableBalance
actualBalance
Constants and SQL Queries
The class defines several constants for SQL queries and account attributes, such as GET_ACCOUNT
GET_ACCOUNTS
ACCOUNT_NUMBER
ACCOUNT_TYPE
Methods for Account Operations
The Account
createAccount
updateAccount
getAccount
Example: Updating Account Information
The updateThis
Account
The updateThis
Account
Account
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