🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.H2 ignores failed updates automatically
  2. B.rollback() undid the credit that had already run
  3. C.The CHECK rule blocked both updates before they ran
  4. 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 →