Java examples for JDBC:SQL Statement
Committing and Rolling Back Updates to a Database
import java.sql.Connection; public class Main { public static void main(String[] args) throws Exception { Connection connection = null; // Disable auto commit connection.setAutoCommit(false);//from w w w .j a v a 2s .co m // Do SQL updates... // Commit updates connection.commit(); connection.rollback(); } }