程序包 gu.sql2java
类 ScriptRunner
java.lang.Object
gu.sql2java.ScriptRunner
Tool to run database scripts.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明addClearRegex(String regex) addClearRegex(Pattern pattern) addIgnoreRegex(Pattern pattern) addReplaceRegex(Pattern pattern, String replacement) voidrunScript(InputStream input) Runs an SQL script (read in using the InputStream parameter).voidRuns an SQL script (read in using the Reader parameter).voidRuns an SQL script (read in using the String parameter).voidRuns an SQL script (read in using the String parameter).set alias name for database connect projectsetClearComment(boolean clearComment) setDelimiter(String delimiter, boolean fullLineDelimiter) Sets the delimiter.setErrorLogWriter(PrintWriter errorLogWriter) Setter for errorLogWriter property.setLogWriter(PrintWriter logWriter) Setter for logWriter property.
-
构造器详细资料
-
ScriptRunner
public ScriptRunner(boolean autoCommit, boolean stopOnError) Default constructor.- 参数:
autoCommit- the auto commitstopOnError- stop on error
-
-
方法详细资料
-
setDelimiter
Sets the delimiter.- 参数:
delimiter- the delimiterfullLineDelimiter- the full line delimiter- 返回:
- this instance
-
setClearComment
- 参数:
clearComment- clear all COMMENT statement in SQL script if true- 返回:
- this instance
-
setAlias
set alias name for database connect project- 参数:
alias-- 返回:
- this instance
-
addClearRegex
-
addClearRegex
-
addIgnoreRegex
-
addReplaceRegex
-
setLogWriter
Setter for logWriter property.- 参数:
logWriter- - the new value of the logWriter property- 返回:
- this instance
-
setErrorLogWriter
Setter for errorLogWriter property.- 参数:
errorLogWriter- - the new value of the errorLogWriter property- 返回:
- this instance
-
runScript
Runs an SQL script (read in using the Reader parameter).- 参数:
reader- - the source of the script- 抛出:
IOException- Signals that an I/O exception has occurred.gu.sql2java.exception.DaoException- the wrapped SQL exception
-
runScript
Runs an SQL script (read in using the String parameter).- 参数:
input- - the source of the script- 抛出:
IOExceptiongu.sql2java.exception.DaoException
-
runScript
Runs an SQL script (read in using the String parameter).- 参数:
input- - the source of the script- 抛出:
IOExceptiongu.sql2java.exception.DaoException
-
runScript
Runs an SQL script (read in using the InputStream parameter).- 参数:
input- - the source of the script- 抛出:
IOExceptiongu.sql2java.exception.DaoException
-
getExecutableSqls
- 返回:
- all executable SQL statement of last call runScript
-