提交 d6383f94 authored 作者: Thomas Mueller's avatar Thomas Mueller

The API of the tools changed a bit.

上级 83530bdf
...@@ -3,7 +3,7 @@ org.h2.tools.Backup.main=Options are case sensitive. Supported options are\:\n[- ...@@ -3,7 +3,7 @@ org.h2.tools.Backup.main=Options are case sensitive. Supported options are\:\n[-
org.h2.tools.ChangeFileEncryption=Allows changing the database file encryption password or algorithm.\nThis tool can not be used to change a password of a user. org.h2.tools.ChangeFileEncryption=Allows changing the database file encryption password or algorithm.\nThis tool can not be used to change a password of a user.
org.h2.tools.ChangeFileEncryption.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-cipher type] The encryption type (AES or XTEA)\n[-dir <dir>] The database directory (default\: .)\n[-db <database>] Database name (all databases if not set)\n[-decrypt <pwd>] The decryption password (if not set\: not yet encrypted)\n[-encrypt <pwd>] The encryption password (if not set\: do not encrypt)\n[-quiet] Do not print progress information org.h2.tools.ChangeFileEncryption.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-cipher type] The encryption type (AES or XTEA)\n[-dir <dir>] The database directory (default\: .)\n[-db <database>] Database name (all databases if not set)\n[-decrypt <pwd>] The decryption password (if not set\: not yet encrypted)\n[-encrypt <pwd>] The encryption password (if not set\: do not encrypt)\n[-quiet] Do not print progress information
org.h2.tools.Console=Starts the H2 Console (web-) server, as well as the TCP and PG server. org.h2.tools.Console=Starts the H2 Console (web-) server, as well as the TCP and PG server.
org.h2.tools.Console.main=When running without options, -tcp, -web, -browser and -pg are started.\nOptions are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-web] Start the web server with the H2 Console\n[-tool] Start the icon or window that allows to start a browser\n[-browser] Start a browser and open a page to connect to the web server\n[-tcp] Start the TCP server\n[-pg] Start the PG server\nFor each Server, additional options are available; for details, see the Server tool.\nIf a service can not be started, the program terminates with an exit code of 1. org.h2.tools.Console.main=When running without options, -tcp, -web, -browser and -pg are started.\nOptions are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-web] Start the web server with the H2 Console\n[-tool] Start the icon or window that allows to start a browser\n[-browser] Start a browser and open a page to connect to the web server\n[-tcp] Start the TCP server\n[-pg] Start the PG server\nFor each Server, additional options are available;\n for details, see the Server tool.\nIf a service can not be started, the program\n terminates with an exit code of 1.
org.h2.tools.ConvertTraceFile=Converts a .trace.db file to a SQL script and Java source code.\nSQL statement statistics are listed as well. org.h2.tools.ConvertTraceFile=Converts a .trace.db file to a SQL script and Java source code.\nSQL statement statistics are listed as well.
org.h2.tools.ConvertTraceFile.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-traceFile <file>] The trace file name (default\: test.trace.db)\n[-script <file>] The script file name (default\: test.sql)\n[-javaClass <file>] The Java directory and class file name (default\: Test) org.h2.tools.ConvertTraceFile.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-traceFile <file>] The trace file name (default\: test.trace.db)\n[-script <file>] The script file name (default\: test.sql)\n[-javaClass <file>] The Java directory and class file name (default\: Test)
org.h2.tools.CreateCluster=Creates a cluster from a standalone database.\nCopies a database to another location if required. org.h2.tools.CreateCluster=Creates a cluster from a standalone database.\nCopies a database to another location if required.
...@@ -18,7 +18,7 @@ org.h2.tools.RunScript=Runs a SQL script against a database. ...@@ -18,7 +18,7 @@ org.h2.tools.RunScript=Runs a SQL script against a database.
org.h2.tools.RunScript.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-url <url>] The database URL (jdbc\:...)\n[-user <user>] The user name (default\: sa)\n[-password <pwd>] The password\n[-script <file>] The script file to run (default\: backup.sql)\n[-driver <class>] The JDBC driver class to use (not required in most cases)\n[-showResults] Show the statements and the results of queries\n[-checkResults] Check if the query results match the expected results\n[-options ...] A list of options (only for embedded H2, see RUNSCRIPT) org.h2.tools.RunScript.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-url <url>] The database URL (jdbc\:...)\n[-user <user>] The user name (default\: sa)\n[-password <pwd>] The password\n[-script <file>] The script file to run (default\: backup.sql)\n[-driver <class>] The JDBC driver class to use (not required in most cases)\n[-showResults] Show the statements and the results of queries\n[-checkResults] Check if the query results match the expected results\n[-options ...] A list of options (only for embedded H2, see RUNSCRIPT)
org.h2.tools.Script=Creates a SQL script file by extracting the schema and data of a database. org.h2.tools.Script=Creates a SQL script file by extracting the schema and data of a database.
org.h2.tools.Script.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-url <url>] The database URL (jdbc\:...)\n[-user <user>] The user name (default\: sa)\n[-password <pwd>] The password\n[-script <file>] The target script file name (default\: backup.sql)\n[-options ...] A list of options (only for embedded H2, see RUNSCRIPT)\n[-quiet] Do not print progress information org.h2.tools.Script.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-url <url>] The database URL (jdbc\:...)\n[-user <user>] The user name (default\: sa)\n[-password <pwd>] The password\n[-script <file>] The target script file name (default\: backup.sql)\n[-options ...] A list of options (only for embedded H2, see RUNSCRIPT)\n[-quiet] Do not print progress information
org.h2.tools.Server=Starts the H2 Console (web-) server, TCP, PG, and FTP server. org.h2.tools.Server=Starts the H2 Console (web-) server, TCP, and PG server.
org.h2.tools.Server.main=When running without options, -tcp, -web, -browser and -pg are started.\nOptions are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-web] Start the web server with the H2 Console\n[-webAllowOthers] Allow other computers to connect\n[-webPort <port>] The port (default\: 8082)\n[-webSSL] Use encrypted (HTTPS) connections\n[-browser] Start a browser and open a page to connect to the web server\n[-tcp] Start the TCP server\n[-tcpAllowOthers] Allow other computers to connect\n[-tcpPort <port>] The port (default\: 9092)\n[-tcpSSL] Use encrypted (SSL) connections\n[-tcpPassword <pwd>] The password for shutting down a TCP server\n[-tcpShutdown <url>] Stop the TCP server; example\: tcp\://localhost\:9094\n[-tcpShutdownForce] Do not wait until all connections are closed\n[-pg] Start the PG server\n[-pgAllowOthers] Allow other computers to connect\n[-pgPort <port>] The port (default\: 5435)\n[-ftp] Start the FTP server\n[-ftpPort <port>] The port (default\: 8021)\n[-ftpDir <dir>] The base directory (default\: ftp)\n[-ftpRead <user>] The user name for reading (default\: guest)\n[-ftpWrite <user>] The user name for writing (default\: sa)\n[-ftpWritePassword <p>] The write password (default\: sa)\n[-baseDir <dir>] The base directory for H2 databases; for all servers\n[-ifExists] Only existing databases may be opened; for all servers\n[-trace] Print additional trace information; for all servers org.h2.tools.Server.main=When running without options, -tcp, -web, -browser and -pg are started.\nOptions are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-web] Start the web server with the H2 Console\n[-webAllowOthers] Allow other computers to connect\n[-webPort <port>] The port (default\: 8082)\n[-webSSL] Use encrypted (HTTPS) connections\n[-browser] Start a browser and open a page to connect to the web server\n[-tcp] Start the TCP server\n[-tcpAllowOthers] Allow other computers to connect\n[-tcpPort <port>] The port (default\: 9092)\n[-tcpSSL] Use encrypted (SSL) connections\n[-tcpPassword <pwd>] The password for shutting down a TCP server\n[-tcpShutdown <url>] Stop the TCP server; example\: tcp\://localhost\:9094\n[-tcpShutdownForce] Do not wait until all connections are closed\n[-pg] Start the PG server\n[-pgAllowOthers] Allow other computers to connect\n[-pgPort <port>] The port (default\: 5435)\n[-baseDir <dir>] The base directory for H2 databases; for all servers\n[-ifExists] Only existing databases may be opened; for all servers\n[-trace] Print additional trace information; for all servers
org.h2.tools.Shell=Interactive command line tool to access a database using JDBC. org.h2.tools.Shell=Interactive command line tool to access a database using JDBC.
org.h2.tools.Shell.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-url <url>] The database URL (jdbc\:h2\:...)\n[-user <user>] The user name\n[-password <pwd>] The password\n[-driver <class>] The JDBC driver class to use (not required in most cases) org.h2.tools.Shell.main=Options are case sensitive. Supported options are\:\n[-help] or [-?] Print the list of options\n[-url <url>] The database URL (jdbc\:h2\:...)\n[-user <user>] The user name\n[-password <pwd>] The password\n[-driver <class>] The JDBC driver class to use (not required in most cases)
...@@ -62,7 +62,8 @@ ShutdownHandler { ...@@ -62,7 +62,8 @@ ShutdownHandler {
private boolean isWindows; private boolean isWindows;
/** /**
* When running without options, -tcp, -web, -browser and -pg are started.<br /> * When running without options, -tcp, -web, -browser and -pg are started.
* <br />
* Options are case sensitive. Supported options are: * Options are case sensitive. Supported options are:
* <table> * <table>
* <tr><td>[-help] or [-?]</td> * <tr><td>[-help] or [-?]</td>
...@@ -78,8 +79,10 @@ ShutdownHandler { ...@@ -78,8 +79,10 @@ ShutdownHandler {
* <tr><td>[-pg]</td> * <tr><td>[-pg]</td>
* <td>Start the PG server</td></tr> * <td>Start the PG server</td></tr>
* </table> * </table>
* For each Server, additional options are available; for details, see the Server tool.<br /> * For each Server, additional options are available;
* If a service can not be started, the program terminates with an exit code of 1. * for details, see the Server tool.<br />
* If a service can not be started, the program
* terminates with an exit code of 1.
* @h2.resource * @h2.resource
* *
* @param args the command line arguments * @param args the command line arguments
......
...@@ -106,7 +106,6 @@ public class Recover extends Tool implements DataHandler { ...@@ -106,7 +106,6 @@ public class Recover extends Tool implements DataHandler {
* a hardware problem. * a hardware problem.
* *
* @param args the command line arguments * @param args the command line arguments
* @return the exit code
*/ */
public void run(String[] args) throws SQLException { public void run(String[] args) throws SQLException {
String dir = "."; String dir = ".";
......
...@@ -71,7 +71,7 @@ public class Shell extends Tool { ...@@ -71,7 +71,7 @@ public class Shell extends Tool {
/** /**
* Sets the standard error stream. * Sets the standard error stream.
* *
* @param out the new standard error stream * @param err the new standard error stream
*/ */
public void setErr(PrintStream err) { public void setErr(PrintStream err) {
this.err = err; this.err = err;
......
...@@ -42,6 +42,12 @@ public abstract class Tool { ...@@ -42,6 +42,12 @@ public abstract class Tool {
*/ */
public abstract void run(String[] args) throws SQLException; public abstract void run(String[] args) throws SQLException;
/**
* Throw a SQLException saying this command line option is not supported.
*
* @param option the unsupported option
* @return this method never returns normally
*/
protected SQLException throwUnsupportedOption(String option) throws SQLException { protected SQLException throwUnsupportedOption(String option) throws SQLException {
showUsage(); showUsage();
throw new SQLException("Unsupported option: " + option); throw new SQLException("Unsupported option: " + option);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论