🎙 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 8 of 10

Which pair of calls makes several statements all-or-nothing?

Which pair of calls makes several statements all-or-nothing?

  1. A.executeQuery() and next()
  2. B.prepareStatement() and close()
  3. C.setString() and setInt()
  4. D.setAutoCommit(false), then commit() or rollback()
Answer & explanation

Correct answer: setAutoCommit(false), then commit() or rollback()

With auto-commit off, nothing is permanent until commit; rollback undoes everything since.

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 →