|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.farrago.util.SqlRunner
public class SqlRunner
Wrapper around the sqlline code to enable running of a SQL script from within Java code.
| Field Summary | |
|---|---|
protected static Logger |
logger
|
private static InputStream |
quitStream
|
private static SqlRunner |
singleton
|
| Constructor Summary | |
|---|---|
private |
SqlRunner()
Private constructor for singleton use. |
| Method Summary | |
|---|---|
static SqlRunner |
instance()
Get a singleton instance of the SqlRunner class to run one or more scripts with. |
void |
runScript(String pathName,
String url,
String userName,
String password)
Run the specified SQL script against the server at the specified URL using the supplied credentials. |
void |
runScript(String pathName,
String url,
String userName,
String password,
PrintStream out)
Run the specified SQL script against the server at the specified URL using the supplied credentials. |
void |
runScript(String pathName,
String url,
String userName,
String password,
PrintStream out,
PrintStream err)
Run the specified SQL script against the server at the specified URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static SqlRunner singleton
protected static Logger logger
private static InputStream quitStream
| Constructor Detail |
|---|
private SqlRunner()
instance()
method to get an instance of the class to use.
| Method Detail |
|---|
public void runScript(String pathName,
String url,
String userName,
String password)
throws SQLException
pathName - String containing a path name to a SQL scripturl - String specifying the URL of a serveruserName - String specifying the user to log into the server aspassword - String containing the password for the specified user
SQLException
public void runScript(String pathName,
String url,
String userName,
String password,
PrintStream out)
throws SQLException
pathName - String containing a path name to a SQL scripturl - String specifying the URL of a serveruserName - String specifying the user to log into the server aspassword - String containing the password for the specified userout - PrintStream to redirect stdout and stderr to
SQLException
public void runScript(String pathName,
String url,
String userName,
String password,
PrintStream out,
PrintStream err)
throws SQLException
pathName - String containing a path name to a SQL scripturl - String specifying the URL of a serveruserName - String specifying the user to log into the server aspassword - String containing the password for the specified userout - PrintStream to redirect stdout to while executing the script,
or null to leave stdout unchangederr - PrintStream to redirect stderr to while executing the script,
or null to leave stderr unchanged
SQLException - All errors in execution are converted into SQLException and thrown. Null values for either pathName or
url will assert.public static SqlRunner instance()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||