Last active
January 27, 2023 20:27
-
-
Save kubawieczorek/68766b5523ae46683e7f21db6e4aa231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void decreaseAccountBalance(PreparedStatement updateAccountStatement, ResultSet account, BigDecimal amount) throws SQLException { | |
BigDecimal accountBalance = account.getBigDecimal("balance"); | |
updateAccountStatement.setBigDecimal(1, accountBalance.subtract(amount)); | |
updateAccountStatement.setLong(2, account.getLong("version") + 1); | |
updateAccountStatement.setLong(3, account.getLong("account_id")); | |
updateAccountStatement.setLong(4, account.getLong("version")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment