| 构造器和说明 |
|---|
Shell() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
main(String... args)
Options are case sensitive.
|
protected void |
print(String s)
Print the string without newline, and flush.
|
void |
run()
INTERNAL.
|
void |
runTool(Connection conn,
String... args)
Run the shell tool with the given connection and command line settings.
|
void |
runTool(String... args)
Run the shell tool with the given command line settings.
|
void |
setErr(PrintStream err)
Sets the standard error stream.
|
void |
setIn(InputStream in)
Redirects the standard input.
|
void |
setInReader(BufferedReader reader)
Redirects the standard input.
|
isOption, printNoDatabaseFilesFound, setOut, showUsage, showUsageAndThrowUnsupportedOption, throwUnsupportedOptionpublic static void main(String... args) throws 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 argumentsSQLException - on failurepublic void setErr(PrintStream err)
err - the new standard error streampublic void setIn(InputStream in)
in - the input stream to usepublic void setInReader(BufferedReader reader)
reader - the input stream reader to usepublic void runTool(String... args) throws SQLException
runTool 在类中 Toolargs - the command line settingsSQLException - on failurepublic void runTool(Connection conn, String... args) throws 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 settingsSQLException - on failureprotected void print(String s)
s - the string to printCopyright © 2022. All rights reserved.