Skip to content
Sharp

SQL for Java Devs · interview question

Why is it important to use setAutoCommit(false) in JDBC when managing transactions?

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

Correct answer

B. It allows manual control over transaction boundaries.

Why

By setting setAutoCommit(false), you gain control over when transactions are committed, allowing you to group multiple statements into a single transaction. This helps in ensuring atomicity and consistency in your operations.

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 →