What is the purpose of setAutoCommit do?
- A connection is in auto-commit mode by default which means every SQL statement is treated as a transaction and will be automatically committed after it is executed.
- If you want all statements not to be committed until you call the method commit explicitly, you need to disable auto-commit mode.
con.setAutoCommit(false);
- Manual- transaction can be enabled to support instead of the auto-commit mode that is used by default by the JDBC driver, use the Connection object's setAutoCommit() method.
- If a boolean false is passed to setAutoCommit( ), you turn 'off' auto-commit.
- A boolean true can be passed to turn it 'on' again.