@Test public void testRollbackConnection() throws Exception { rollback(null); Connection c = mock(Connection.class); when(c.getAutoCommit()).thenReturn(true); rollback(c); when(c.getAutoCommit()).thenReturn(false); rollback(c); doThrow(new SQLException("Expected")).when(c).rollback(); rollback(c); }
public static void rollback(Savepoint svp, Connection sqlConnection) { if (sqlConnection == null) { return; } try { if (sqlConnection.getAutoCommit()) { return; } if (svp != null) { sqlConnection.rollback(svp); } } catch (Exception ignoredIntentionally) { } }
JdbcUtil { public static void rollback(Savepoint svp, Connection sqlConnection) { if (sqlConnection == null) { return; } try { if (sqlConnection.getAutoCommit()) { return; } if (svp != null) { sqlConnection.rollback(svp); } } catch (Exception ignoredIntentionally) { } } }
JdbcUtil { public static void rollback(Savepoint svp, Connection sqlConnection) { if (sqlConnection == null) { return; } try { if (sqlConnection.getAutoCommit()) { return; } if (svp != null) { sqlConnection.rollback(svp); } } catch (Exception ignoredIntentionally) { } }  }
JdbcUtil { public static void rollback(Savepoint svp, Connection sqlConnection) { if (sqlConnection == null) { return; } try { if (sqlConnection.getAutoCommit()) { return; } if (svp != null) { sqlConnection.rollback(svp); } } catch (Exception ignoredIntentionally) { } }  static void closeQuietly(AutoCloseable... closeables); static void rollback(Savepoint svp, Connection sqlConnection); static void rollback(Connection sqlConnection); static void commit(Connection sqlConnection); static Savepoint createSavepoint(Connection sqlConnection); static Connection testConnection(Connection sqlConnection, String testStatement, boolean debugMode); static Properties mergeConnectionProperties(Properties p, String username, String password); static Connection getConnection(AdaptrisMessage msg, AdaptrisConnection adpCon); static void rollback(Connection sqlConnection, AdaptrisMessage msg); static void commit(Connection sqlConnection, AdaptrisMessage msg); }
JdbcUtil { public static void rollback(Savepoint svp, Connection sqlConnection) { if (sqlConnection == null) { return; } try { if (sqlConnection.getAutoCommit()) { return; } if (svp != null) { sqlConnection.rollback(svp); } } catch (Exception ignoredIntentionally) { } }  static void closeQuietly(AutoCloseable... closeables); static void rollback(Savepoint svp, Connection sqlConnection); static void rollback(Connection sqlConnection); static void commit(Connection sqlConnection); static Savepoint createSavepoint(Connection sqlConnection); static Connection testConnection(Connection sqlConnection, String testStatement, boolean debugMode); static Properties mergeConnectionProperties(Properties p, String username, String password); static Connection getConnection(AdaptrisMessage msg, AdaptrisConnection adpCon); static void rollback(Connection sqlConnection, AdaptrisMessage msg); static void commit(Connection sqlConnection, AdaptrisMessage msg);  }