Skip to content
Sharp

SQL for Java Devs · interview question

What effect does calling connection.setAutoCommit(true) have in JDBC?

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

Correct answer

D. Each SQL statement is treated as a separate transaction and committed automatically.

Why

When auto-commit mode is enabled, each individual SQL statement is treated as its own transaction and is automatically committed to the database upon execution.

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 →