public void deposit(double amount)
throws SQLException
{
Connection conn = SimpleDataSource.getConnection();
try
{
PreparedStatement stat = conn.prepareStatement(
"UPDATE Account"
+ " SET Balance = Balance + ?"
+ " WHERE Account_Number = ?");
stat.setDouble(1, amount);
stat.setInt(2, accountNumber);
stat.executeUpdate();
}
finally
{
conn.close();
}
}