com.ibatis.common.jdbc

Class ScriptRunner

public class ScriptRunner extends Object

Tool to run database scripts
Constructor Summary
ScriptRunner(Connection connection, boolean autoCommit, boolean stopOnError)
Default constructor
ScriptRunner(String driver, String url, String username, String password, boolean autoCommit, boolean stopOnError)
Method Summary
voidrunScript(Reader reader)
Runs an SQL script (read in using the Reader parameter)
voidsetDelimiter(String delimiter, boolean fullLineDelimiter)
voidsetErrorLogWriter(PrintWriter errorLogWriter)
Setter for errorLogWriter property
voidsetLogWriter(PrintWriter logWriter)
Setter for logWriter property

Constructor Detail

ScriptRunner

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

ScriptRunner

public ScriptRunner(String driver, String url, String username, String password, boolean autoCommit, boolean stopOnError)

Method Detail

runScript

public void runScript(Reader reader)
Runs an SQL script (read in using the Reader parameter)

Parameters: reader - the source of the script

setDelimiter

public void setDelimiter(String delimiter, boolean fullLineDelimiter)

setErrorLogWriter

public void setErrorLogWriter(PrintWriter errorLogWriter)
Setter for errorLogWriter property

Parameters: errorLogWriter - the new value of the errorLogWriter property

setLogWriter

public void setLogWriter(PrintWriter logWriter)
Setter for logWriter property

Parameters: logWriter - the new value of the logWriter property

Copyright © 2011. All Rights Reserved.