Package nl.b3p.topnl

Class ScriptRunner

java.lang.Object
nl.b3p.topnl.ScriptRunner

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

    • 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 Details

    • setDelimiter

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

      public void runScript(Reader reader) throws IOException, SQLException
      Runs a SQL script (read in using the Reader parameter).
      Parameters:
      reader - the source of the script
      Throws:
      IOException - if any occurs connecting to the database
      SQLException - if any occurs executing the script