public class ScriptRunner extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
delimP
regex to detect delimiter.
|
| Constructor and Description |
|---|
ScriptRunner(Connection connection,
boolean autoCommit,
boolean stopOnError)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
static void |
runScript(DatabaseConf dbConf,
String scriptFile) |
void |
runScript(Reader reader)
Runs an SQL script (read in using the Reader parameter)
|
void |
runScript(String filepath)
Runs an SQL script (read in using the Reader parameter)
|
void |
setDelimiter(String delimiter,
boolean fullLineDelimiter) |
void |
setErrorLogWriter(PrintWriter errorLogWriter)
Setter for errorLogWriter property
|
void |
setLogWriter(PrintWriter logWriter)
Setter for logWriter property
|
public static final Pattern delimP
public ScriptRunner(Connection connection, boolean autoCommit, boolean stopOnError)
public static void runScript(DatabaseConf dbConf, String scriptFile) throws Exception
Exceptionpublic void setDelimiter(String delimiter, boolean fullLineDelimiter)
public void setLogWriter(PrintWriter logWriter)
logWriter - - the new value of the logWriter propertypublic void setErrorLogWriter(PrintWriter errorLogWriter)
errorLogWriter - - the new value of the errorLogWriter propertypublic void runScript(String filepath) throws IOException, SQLException
filepath - - the filepath of the script to run. May be relative to the userDirectory.IOExceptionSQLExceptionpublic void runScript(Reader reader) throws IOException, SQLException
reader - - the source of the scriptIOExceptionSQLExceptionCopyright © 2023. All rights reserved.