Skip to content
Sharp

SQL for Java Devs · interview question

Which JDBC method is used to revert changes made in the current transaction?

Multiple choiceMediumchapter-8-curatedpremiumsql-for-java-devstransactions
Choose one answer
Answer and explanation

Correct answer

B. Rollback()

Why

The rollback() method is used to undo all changes made in the current transaction. This is useful for reverting changes if an error occurs during the transaction.

Test yourself on SQL for Java Devs

A free test with instant, explained results. No account needed.

Start free test
All SQL for Java Devs questions →