The transaction mechanism of the Oracle database is a simple record: con. commit (); The transaction is committed manually. Con. setAutoCommit (true); enables JDBC to automatically commit transactions. Con. rollback (); cancels the submission of rollback data. If con. setAutoCommit (true) is used, after the database operation, the data has been actually updated to the database and no more commit is required. At this time, calling con. rollback () is useless. If this parameter is set to false, JDBC does not submit data automatically. Therefore, you must manually use commit or rollback to submit or roll back data. No transaction control is required during query. transaction control is required only when multiple different data in the database needs to be processed synchronously. for example, if a bank withdraws money, it must have a withdrawal record and a change record of the account. If a single withdrawal record occurs, it cannot be set to false, after both operations are completed, use commit to submit them together. if one of them has a problem, you can use rollback to roll back both of them to ensure data consistency.