public int[] execute() {
        // short circuit empty batch
        if (parts.isEmpty()) {
            return new int[] {};
        }

        @SuppressWarnings("PMD.CloseResource")
        Statement stmt;
        try {
            try {
                stmt = createStatement();
                getContext().addCleanable(() -> cleanupStatement(stmt));
                getConfig(SqlStatements.class).customize(stmt);
            } catch (SQLException e) {
                throw new UnableToCreateStatementException(e, getContext());
            }

            LOG.trace("Execute batch [");

            try {
                for (String part : parts) {
                    final String sql = getConfig(SqlStatements.class).getTemplateEngine().render(part, getContext());
                    LOG.trace(" {}", sql);
                    stmt.addBatch(sql);
                }
            } catch (SQLException e) {
                throw new UnableToExecuteStatementException("Unable to configure JDBC statement", e, getContext());
            }

            try {
                return SqlLoggerUtil.wrap(stmt::executeBatch, getContext(), getConfig(SqlStatements.class).getSqlLogger());
            } catch (SQLException e) {
                throw new UnableToExecuteStatementException(mungeBatchException(e), getContext());
            }
        } finally {
            close();
        }
    }
Execute the batch and return the number of rows affected for each batch part.
Note that some database drivers might return special values like {@link Statement#SUCCESS_NO_INFO}
or {@link Statement#EXECUTE_FAILED}.

@return the number of rows affected per batch part
@see Statement#executeBatch()
core/src/main/java/org/jdbi/v3/core/statement/Batch.java