public class Shell extends Tool implements java.lang.Runnable
| Constructor and Description |
|---|
Shell() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String... args)
Options are case sensitive.
|
protected void |
print(java.lang.String s)
Print the string without newline, and flush.
|
void |
run()
INTERNAL.
|
void |
runTool(java.sql.Connection conn,
java.lang.String... args)
Run the shell tool with the given connection and command line settings.
|
void |
runTool(java.lang.String... args)
Run the shell tool with the given command line settings.
|
void |
setErr(java.io.PrintStream err)
Sets the standard error stream.
|
void |
setIn(java.io.InputStream in)
Redirects the standard input.
|
void |
setInReader(java.io.BufferedReader reader)
Redirects the standard input.
|
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOptionpublic static void main(java.lang.String... args)
throws java.sql.SQLException
| [-help] or [-?] | Print the list of options |
| [-url "<url>"] | The database URL (jdbc:h2:...) |
| [-user <user>] | The user name |
| [-password <pwd>] | The password |
| [-driver <class>] | The JDBC driver class to use (not required in most cases) |
| [-sql "<statements>"] | Execute the SQL statements and exit |
| [-properties "<dir>"] | Load the server properties from this directory |
args - the command line argumentsjava.sql.SQLExceptionpublic void setErr(java.io.PrintStream err)
err - the new standard error streampublic void setIn(java.io.InputStream in)
in - the input stream to usepublic void setInReader(java.io.BufferedReader reader)
reader - the input stream reader to usepublic void runTool(java.lang.String... args)
throws java.sql.SQLException
public void runTool(java.sql.Connection conn,
java.lang.String... args)
throws java.sql.SQLException
Note: using the "-url" option in args doesn't make much sense
since it will override the conn parameter.
conn - the connectionargs - the command line settingsjava.sql.SQLExceptionprotected void print(java.lang.String s)
s - the string to printpublic void run()
run in interface java.lang.Runnable