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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *