Each statement is treated as transaction by default. It means, after each statement, a commit operation is performed which is an expensive operation. Sometimes, you want a set of statements to behave as a unit. In that case, you want to turn off the auto commit. This can be done as follows:

Java Code:
connecton.setAutoCommit(false);
To manually commit a transaction:

Java Code:
connection.commit();