Here you can find the source of rollback(Connection connection)
Roll back the transaction of the given connection.
Parameter | Description |
---|---|
connection | the connection that used to roll back the transcation. If it is null, nothing would happen |
public static void rollback(Connection connection)
//package com.java2s; import java.sql.Connection; import java.sql.SQLException; public class Main { /**//from w w w .java 2s . c om * <p> * Roll back the transaction of the given connection. * </p> * * @param connection the connection that used to roll back the transcation. If it is null, * nothing would happen */ public static void rollback(Connection connection) { if (connection != null) { try { connection.rollback(); } catch (SQLException e) { // ignore the exception here. } } } }