To handle a transaction in JDBC, first, you must set the auto-commit mode to ________ before starting the transaction.
- FALSE
- TRUE
- commit
- rollback
In JDBC, to handle a transaction, you must set the auto-commit mode to false using the setAutoCommit(false) method before starting the transaction. This ensures that multiple SQL statements can be treated as a single transaction until explicitly committed. Setting it to true would mean auto-commit mode is enabled, where each SQL statement is treated as a separate transaction.
Loading...
Related Quiz
- What is method overloading in Java?
- Which exception might be thrown when opening a file for reading?
- What is the role of the JavaFX Application Thread?
- ________ is an interface providing thread safety without introducing concurrency overhead for each individual read/write operation.
- The class ________ allows an application to read bytes from a file, modifying them, and then writing them back to the file.