com.ibatis.common.jdbc
Class ScriptRunner

java.lang.Object
  extended bycom.ibatis.common.jdbc.ScriptRunner

public class ScriptRunner
extends java.lang.Object

Tool to run database scripts


Constructor Summary
ScriptRunner(java.sql.Connection connection, boolean autoCommit, boolean stopOnError)
          Default constructor
ScriptRunner(java.lang.String driver, java.lang.String url, java.lang.String username, java.lang.String password, boolean autoCommit, boolean stopOnError)
           
 
Method Summary
 void runScript(java.io.Reader reader)
          Runs an SQL script (read in using the Reader parameter)
 void setErrorLogWriter(java.io.PrintWriter errorLogWriter)
          Setter for errorLogWriter property
 void setLogWriter(java.io.PrintWriter logWriter)
          Setter for logWriter property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptRunner

public ScriptRunner(java.sql.Connection connection,
                    boolean autoCommit,
                    boolean stopOnError)
Default constructor


ScriptRunner

public ScriptRunner(java.lang.String driver,
                    java.lang.String url,
                    java.lang.String username,
                    java.lang.String password,
                    boolean autoCommit,
                    boolean stopOnError)
Method Detail

setLogWriter

public void setLogWriter(java.io.PrintWriter logWriter)
Setter for logWriter property

Parameters:
logWriter - - the new value of the logWriter property

setErrorLogWriter

public void setErrorLogWriter(java.io.PrintWriter errorLogWriter)
Setter for errorLogWriter property

Parameters:
errorLogWriter - - the new value of the errorLogWriter property

runScript

public void runScript(java.io.Reader reader)
               throws java.io.IOException,
                      java.sql.SQLException
Runs an SQL script (read in using the Reader parameter)

Parameters:
reader - - the source of the script
Throws:
java.io.IOException
java.sql.SQLException