statement.close();
if (statement != null) { statement.close(); }
    public void execute(IDatabaseConnection connection, IDataSet dataSet)            throws DatabaseUnitException, SQLException    {        DatabaseConfig databaseConfig = connection.getConfig();        IStatementFactory factory = (IStatementFactory)databaseConfig.getProperty(                DatabaseConfig.PROPERTY_STATEMENT_FACTORY);        // for each table        ITableIterator iterator = iterator(dataSet);        while (iterator.next())        {            ITable table = iterator.getTable();            // Do not process empty table            if (isEmpty(table))            {                continue;            }            ITableMetaData metaData = getOperationMetaData(connection,                    table.getTableMetaData());            BigInteger ignoreMapping = null;            OperationData operationData = null;            IPreparedBatchStatement statement = null;            try            {                // For each row                int start = _reverseRowOrder ? table.getRowCount() - 1 : 0;                int increment = _reverseRowOrder ? -1 : 1;                try                {                    for (int i = start; ; i = i + increment)                    {                        int row = i;                        // If current row have a diffrent ignore value mapping than                        // previous one, we generate a new statement                        if (ignoreMapping == null || !equalsIgnoreMapping(ignoreMapping, table, row))                        {                            // Execute and close previous statement                            if (statement != null)                            {                                statement.executeBatch();                                statement.clearBatch();                                statement.close();                            }                            ignoreMapping = getIngnoreMapping(table, row);                            operationData = getOperationData(metaData, ignoreMapping, connection);                            statement = factory.createPreparedBatchStatement(                                    operationData.getSql(), connection);                        }                        // for each column                        Column[] columns = operationData.getColumns();                        for (int j = 0; j < columns.length; j++)                        {                            // Bind value only if not in ignore mapping                            if (!ignoreMapping.testBit(j))                            {                                Column column = columns[j];                                statement.addValue(table.getValue(row,                                        column.getColumnName()), column.getDataType());                            }                        }                        statement.addBatch();                    }                }                catch (RowOutOfBoundsException e)                {                    // end of table                }                statement.executeBatch();                statement.clearBatch();            }            finally            {                statement.close();            }        }    }