← Quiz: JDBC: all 10 questions
Quiz: JDBC · Question 4 of 10
In TransferDemo, why are both balances unchanged after the failed transfer?
In TransferDemo, why are both balances unchanged after the failed transfer?
- A.H2 ignores failed updates automatically
- B.rollback() undid the credit that had already run
- C.The CHECK rule blocked both updates before they ran
- D.Auto-commit saved only the second update
Answer & explanation
Correct answer: rollback() undid the credit that had already run
With auto-commit off, rollback() cancels every change since the last commit.
Can you get the rest right without peeking?
Take the timed Quiz: JDBC quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →