|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ibatis.common.jdbc.ScriptRunner
Tool to run database scripts
| Field Summary | |
private boolean |
autoCommit
|
private java.lang.String |
driver
|
private java.io.PrintWriter |
errorLogWriter
|
private java.io.PrintWriter |
logWriter
|
private java.lang.String |
password
|
private boolean |
stopOnError
|
private java.lang.String |
url
|
private java.lang.String |
username
|
| Constructor Summary | |
ScriptRunner()
Default constructor |
|
ScriptRunner(java.util.Map props)
Constructor to allow passing in a Map with configuration data |
|
| Method Summary | |
private void |
flush()
|
java.lang.String |
getDriver()
Getter for driver property |
java.io.PrintWriter |
getErrorLogWriter()
Getter for errorLogWriter property |
java.io.PrintWriter |
getLogWriter()
Getter for logWriter property |
java.lang.String |
getPassword()
Getter for password property |
java.lang.String |
getUrl()
Getter for url property |
java.lang.String |
getUsername()
Getter for username property |
boolean |
isAutoCommit()
Getter for autoCommit property |
boolean |
isStopOnError()
Getter for stopOnError property |
private void |
print(java.lang.Object o)
|
private void |
println(java.lang.Object o)
|
private void |
printlnError(java.lang.Object o)
|
void |
runScript(java.sql.Connection conn,
java.io.Reader reader)
Runs an SQL script (read in using the Reader parameter) using the connection passed in |
void |
runScript(java.io.Reader reader)
Runs an SQL script (read in using the Reader parameter) |
void |
setAutoCommit(boolean autoCommit)
Setter for autoCommit property |
void |
setDriver(java.lang.String driver)
Setter for driver property |
void |
setErrorLogWriter(java.io.PrintWriter errorLogWriter)
Setter for errorLogWriter property |
void |
setLogWriter(java.io.PrintWriter logWriter)
Setter for logWriter property |
void |
setPassword(java.lang.String password)
Setter for password property |
void |
setStopOnError(boolean stopOnError)
Setter for stopOnError property |
void |
setUrl(java.lang.String url)
Setter for url property |
void |
setUsername(java.lang.String username)
Setter for username property |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.lang.String driver
private java.lang.String url
private java.lang.String username
private java.lang.String password
private boolean stopOnError
private boolean autoCommit
private java.io.PrintWriter logWriter
private java.io.PrintWriter errorLogWriter
| Constructor Detail |
public ScriptRunner()
public ScriptRunner(java.util.Map props)
props - - the configuration properties| Method Detail |
public boolean isStopOnError()
public void setStopOnError(boolean stopOnError)
stopOnError - - the new value of the stopOnError propertypublic boolean isAutoCommit()
public void setAutoCommit(boolean autoCommit)
autoCommit - - the new value of the autoCommit propertypublic java.io.PrintWriter getLogWriter()
public void setLogWriter(java.io.PrintWriter logWriter)
logWriter - - the new value of the logWriter propertypublic java.io.PrintWriter getErrorLogWriter()
public void setErrorLogWriter(java.io.PrintWriter errorLogWriter)
errorLogWriter - - the new value of the errorLogWriter propertypublic java.lang.String getDriver()
public void setDriver(java.lang.String driver)
driver - - the new value of the driver propertypublic java.lang.String getUrl()
public void setUrl(java.lang.String url)
url - - the new value of the url propertypublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username - - the new value of the username propertypublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - - the new value of the password property
public void runScript(java.io.Reader reader)
throws java.lang.ClassNotFoundException,
java.sql.SQLException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
reader - - the source of the script
java.lang.ClassNotFoundException - if the driver class cannot be found
java.sql.SQLException - if any SQL errors occur
java.io.IOException - if there is an error reading from the Reader
java.lang.IllegalAccessException - if there are problems creating the driver class
java.lang.InstantiationException - if there are problems creating the driver class
public void runScript(java.sql.Connection conn,
java.io.Reader reader)
throws java.io.IOException,
java.sql.SQLException
conn - - the connection to use for the scriptreader - - the source of the script
java.sql.SQLException - if any SQL errors occur
java.io.IOException - if there is an error reading from the Readerprivate void print(java.lang.Object o)
private void println(java.lang.Object o)
private void printlnError(java.lang.Object o)
private void flush()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||