<commit_before>package uk.ac.ebi.gxa.db;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.LineNumberReader;
import java.io.Reader;
import java.sql.*;

import static org.apache.commons.lang.StringUtils.startsWithIgnoreCase;

/**
 * Oracle-aware script runner
 * <p/>
 * Hugely based on {@link com.carbonfive.db.jdbc.ScriptRunner} - the only significant difference is
 * that all the parsing is removed (well, comments are still excluded and logged)
 *
 * @author alf
 */
public class OracleScriptRunner {
    private final Logger logger = LoggerFactory.getLogger(getClass());
    private static final String DEFAULT_DELIMITER = ";";
    private static final String ORACLE_HACK = "/";

    public void execute(Connection connection, Reader reader) throws IOException, SQLException {
        try {
            final boolean originalAutoCommit = connection.getAutoCommit();
            try {
                if (originalAutoCommit) {
                    connection.setAutoCommit(false);
                }
                doExecute(connection, reader);
            } finally {
                connection.setAutoCommit(originalAutoCommit);
            }
        } catch (IOException e) {
            throw e;
        } catch (SQLException e) {
            throw e;
        } catch (Exception e) {<commit_msg>Updated documentation to reflect the state of affairs<commit_after>package uk.ac.ebi.gxa.db;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.LineNumberReader;
import java.io.Reader;
import java.sql.*;

import static org.apache.commons.lang.StringUtils.startsWithIgnoreCase;

/**
 * Oracle-aware script runner
 * <p/>
 * Hugely based on {@link com.carbonfive.db.jdbc.ScriptRunner} - the only significant difference is
 * that we now support Oracle's dirty hack with slash, <tt>/</tt>, meaning literally
 * "now just send to the database whatever you've got in your
 * <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch4.htm#i1039357">SQL buffer</a>."
 * <p/>
 * For more details, refer to
 * <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch4.htm#i1039663">Oracle documentation</a>
 * on PL/SQL scripts.
 *
 * @author alf
 */
public class OracleScriptRunner {
    private final Logger logger = LoggerFactory.getLogger(getClass());
    private static final String DEFAULT_DELIMITER = ";";
    private static final String ORACLE_HACK = "/";

    public void execute(Connection connection, Reader reader) throws IOException, SQLException {
        try {
            final boolean originalAutoCommit = connection.getAutoCommit();
            try {
                if (originalAutoCommit) {
                    connection.setAutoCommit(false);
                }
                doExecute(connection, reader);
            } finally {
                connection.setAutoCommit(originalAutoCommit);
            }
        } catch (IOException e) {
            throw e;
        } catch (SQLException e) {
            throw e;
        } catch (Exception e) {
{'fraction_non_alphanumeric': 0.10054785691266516, 'fraction_numerical': 0.016113438607798906, 'mean_word_length': 2.717365269461078, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2277121', 'n_tokens_mistral': 889, 'n_tokens_neox': 852, 'n_words': 230}