Skip to content
Sharp

SQL for Java Devs · interview question

Which JDBC method should you call to ensure all changes in a transaction are discarded?

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

Correct answer

D. Rollback()

Why

The rollback() method is used to discard all changes made in the current transaction, reverting the database to its previous state.

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 →