Here you can find the source of rollback(Connection connection)
Parameter | Description |
---|---|
connection | a parameter |
Parameter | Description |
---|---|
SQLException | an exception |
public static void rollback(Connection connection) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.Connection; import java.sql.SQLException; public class Main { /**//from w w w .j a v a2 s . c o m * Undo all changes made by the {@link Connection}. * * @param connection * @throws SQLException */ public static void rollback(Connection connection) throws SQLException { if (connection != null && !connection.getAutoCommit()) { connection.rollback(); } } }