Class ScriptRunner


  • public class ScriptRunner
    extends Object
    Tool to run database scripts
    • Constructor Detail

      • ScriptRunner

        public ScriptRunner​(Connection connection,
                            boolean autoCommit,
                            boolean stopOnError)
        Default constructor.
        Parameters:
        connection - database connection
        autoCommit - true when to autocommit
        stopOnError - true when to stop on error
    • Method Detail

      • setDelimiter

        public void setDelimiter​(String delimiter,
                                 boolean fullLineDelimiter)
      • runScript

        public void runScript​(Reader reader,
                              boolean canFail)
                       throws SQLException
        Runs a SQL script (read in using the Reader parameter).
        Parameters:
        reader - the source of the script
        canFail - May the script contain failing statements
        Throws:
        SQLException - if any occurs executing the script