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();
Sur cette page du site, vous pouvez voir la vidéo en ligne Java Tutorial 89 - JDBC 6/7 Transactions durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Ken 30 mai 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 95 fois et il a aimé 2 téléspectateurs. Bon visionnage!