In this tutorial, I will show you how to use transactions. There are times when you do not want one statement to take effect unless another one completes. When a connection is created, it is in auto-commit mode. This means that each SQL statement is treated as a transaction and is automatically committed right after it is executed. After the auto-commit mode is disabled, no SQL statements are committed until you call the method commit explicitly.
// Set auto-commit mode
conn.setAutoCommit(false);
// rollback the transaction.
conn.rollback();
// commit the transaction.
conn.commit();
On this page of the site you can watch the video online Java Tutorial 89 - JDBC 6/7 Transactions with a duration of hours minute second in good quality, which was uploaded by the user Ken 30 May 2020, share the link with friends and acquaintances, this video has already been watched 95 times on youtube and it was liked by 2 viewers. Enjoy your viewing!