@Test public void testCommit() throws Exception { commit(null); Connection c = mock(Connection.class); when(c.getAutoCommit()).thenReturn(true); commit(c); when(c.getAutoCommit()).thenReturn(false); commit(c); try { doThrow(new SQLException("Expected")).when(c).commit(); commit(c); fail(); } catch (SQLException expected) { } }
public static void commit(Connection sqlConnection) throws SQLException { if (sqlConnection == null) { return; } if (!sqlConnection.getAutoCommit()) { sqlConnection.commit(); } }
JdbcUtil { public static void commit(Connection sqlConnection) throws SQLException { if (sqlConnection == null) { return; } if (!sqlConnection.getAutoCommit()) { sqlConnection.commit(); } } }
JdbcUtil { public static void commit(Connection sqlConnection) throws SQLException { if (sqlConnection == null) { return; } if (!sqlConnection.getAutoCommit()) { sqlConnection.commit(); } }  }
JdbcUtil { public static void commit(Connection sqlConnection) throws SQLException { if (sqlConnection == null) { return; } if (!sqlConnection.getAutoCommit()) { sqlConnection.commit(); } }  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 commit(Connection sqlConnection) throws SQLException { if (sqlConnection == null) { return; } if (!sqlConnection.getAutoCommit()) { sqlConnection.commit(); } }  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);  }