snaker-core/src/main/java/org/snaker/engine/access/ScriptRunner.java
public void runScript(Reader reader) throws IOException, SQLException {
        AssertHelper.notNull(connection);
        try {
            boolean originalAutoCommit = connection.getAutoCommit();
            try {
                if (originalAutoCommit != this.autoCommit) {
                    connection.setAutoCommit(this.autoCommit);
                }
                runScript(connection, reader);
            } finally {
                connection.setAutoCommit(originalAutoCommit);
            }
        } catch (IOException e) {
            throw e;
        } catch (SQLException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException("Error running script.  Cause: " + e, e);
        }
    }
public void runScript(Reader reader) throws IOException, SQLException {
        AssertHelper.notNull(connection);
        try {
            boolean originalAutoCommit = connection.getAutoCommit();
            try {
                if (originalAutoCommit != this.autoCommit) {
                    connection.setAutoCommit(this.autoCommit);
                }
                runScript(connection, reader);
            } finally {
                connection.setAutoCommit(originalAutoCommit);
            }
        } catch (IOException e) {
            throw e;
        } catch (SQLException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException("Error running script.  Cause: " + e, e);
        }
    }
public void runScript ( Reader reader ) throws IOException , SQLException { AssertHelper . notNull ( connection ) ; try { boolean originalAutoCommit = connection . getAutoCommit ( ) ; try { if ( originalAutoCommit != this . autoCommit ) { connection . setAutoCommit ( this . autoCommit ) ; } runScript ( connection , reader ) ; } finally { connection . setAutoCommit ( originalAutoCommit ) ; } } catch ( IOException e ) { throw e ; } catch ( SQLException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( "Error running script.  Cause: " + e , e ) ; } }
根据reader读取sql脚本，并运行
@param reader 脚本资源
根据reader读取sql脚本，并运行