Turning off auto-commit

You can disable auto-commit with the Connection class's setAutoCommit method.

conn.setAutoCommit(false);
Related concepts
Transactions when auto-commit is disabled
Using auto-commit
Explicitly closing Statements, ResultSets, and Connections
Statement versus transaction runtime rollback