Changes are automatically committed during DML operations, which is called the auto-commit mode.
You can disable the auto-commit mode by calling the following method on the Connection object:
conn.setAutoCommit(false);
If the auto-commit mode is disabled, you must call the following method on the Connection object to commit the changes:
conn.commit();
You can also run the following command to roll back the changes:
conn.rollback();
The COMMIT or ROLLBACK operation affects all DML statements executed since the last COMMIT or ROLLBACK operation.
Note
A DDL operation will eventually result in an implicit COMMIT operation. If the auto-commit mode is disabled, the implicit COMMIT operation implicitly commits the DML operations that have not been explicitly committed or rolled back.