What is the purpose of setAutoCommit do?

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.
What is JDBC driver?
What is JDBC driver? - The JDBC Driver provided by the JDBC API, is a vendor-specific implementations of the abstract classes....
What are the steps required to execute a query in JDBC?
What are the steps required to execute a query in JDBC? - Register the driver with DriverManager class.....
What is Connection pooling?
What is Connection pooling? - A Connection pooling is a technique of reusing active database connections instead of creating a new connection.....
Post your comment