Package org.apache.ibatis.jdbc
Class ScriptRunner
java.lang.Object
org.apache.ibatis.jdbc.ScriptRunner
This is an internal testing utility.
You are welcome to use this class for your own purposes,
but if there is some feature/enhancement you need for your own usage,
please make and modify your own copy instead of sending us an enhancement request.
You are welcome to use this class for your own purposes,
but if there is some feature/enhancement you need for your own usage,
please make and modify your own copy instead of sending us an enhancement request.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final Connectionprivate static final Stringprivate Stringprivate static final Patternprivate PrintWriterprivate booleanprivate booleanprivate static final Stringprivate PrintWriterprivate booleanprivate booleanprivate booleanprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidcheckWarnings(Statement statement) voidDeprecated.Since 3.5.4, this method is deprecated.private booleancommandReadyToExecute(String trimmedLine) private voidprivate voidexecuteFullScript(Reader reader) private voidexecuteLineByLine(Reader reader) private voidexecuteStatement(String command) private voidhandleLine(StringBuilder command, String line) private booleanlineIsComment(String trimmedLine) private voidprivate voidprivate voidprivate voidprintResults(Statement statement, boolean hasResults) private voidvoidprivate voidvoidsetAutoCommit(boolean autoCommit) voidsetDelimiter(String delimiter) voidsetErrorLogWriter(PrintWriter errorLogWriter) voidsetEscapeProcessing(boolean escapeProcessing) Sets the escape processing.voidsetFullLineDelimiter(boolean fullLineDelimiter) voidsetLogWriter(PrintWriter logWriter) voidsetRemoveCRs(boolean removeCRs) voidsetSendFullScript(boolean sendFullScript) voidsetStopOnError(boolean stopOnError) voidsetThrowWarning(boolean throwWarning)
-
Field Details
-
LINE_SEPARATOR
-
DEFAULT_DELIMITER
- See Also:
-
DELIMITER_PATTERN
-
connection
-
stopOnError
private boolean stopOnError -
throwWarning
private boolean throwWarning -
autoCommit
private boolean autoCommit -
sendFullScript
private boolean sendFullScript -
removeCRs
private boolean removeCRs -
escapeProcessing
private boolean escapeProcessing -
logWriter
-
errorLogWriter
-
delimiter
-
fullLineDelimiter
private boolean fullLineDelimiter
-
-
Constructor Details
-
ScriptRunner
-
-
Method Details
-
setStopOnError
public void setStopOnError(boolean stopOnError) -
setThrowWarning
public void setThrowWarning(boolean throwWarning) -
setAutoCommit
public void setAutoCommit(boolean autoCommit) -
setSendFullScript
public void setSendFullScript(boolean sendFullScript) -
setRemoveCRs
public void setRemoveCRs(boolean removeCRs) -
setEscapeProcessing
public void setEscapeProcessing(boolean escapeProcessing) Sets the escape processing.- Parameters:
escapeProcessing- the new escape processing- Since:
- 3.1.1
-
setLogWriter
-
setErrorLogWriter
-
setDelimiter
-
setFullLineDelimiter
public void setFullLineDelimiter(boolean fullLineDelimiter) -
runScript
-
executeFullScript
-
executeLineByLine
-
closeConnection
Deprecated.Since 3.5.4, this method is deprecated. Please close theConnectionoutside of this class. -
setAutoCommit
private void setAutoCommit() -
commitConnection
private void commitConnection() -
rollbackConnection
private void rollbackConnection() -
checkForMissingLineTerminator
-
handleLine
- Throws:
SQLException
-
lineIsComment
-
commandReadyToExecute
-
executeStatement
- Throws:
SQLException
-
checkWarnings
- Throws:
SQLException
-
printResults
-
print
-
println
-
printlnError
-