According to the documentation, the connection object can have auto-commit mode either enabled (default mode) or disabled. When auto-commit is false:
If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by a call to either the method commit or the method rollback. By default, new connections are in auto-commit mode.
Therefore if auto-commit is false, the first batch will be committed before the second. If auto-commit is true, the first and second batches will be committed as one transaction. Note that Connection.close()
should only be used when auto-commit is false.
In both cases, the execution order (regardless of the commit mode) follows the order in the code.