← 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?
- A.executeQuery() and next()
- B.prepareStatement() and close()
- C.setString() and setInt()
- 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 →