| java.lang.Object org.h2.tools.Server
Constructor Summary | |
public | Server() |
createFtpServer | public static Server createFtpServer(String[] args) throws SQLException(Code) | | Create a new ftp server, but does not start it yet. Example:
Server server = Server.createFtpServer(
new String[] { "-log", "true" }).start();
Parameters: args - the server |
createPgServer | public static Server createPgServer(String[] args) throws SQLException(Code) | | Create a new PG server, but does not start it yet.
Example:
Server server =
Server.createPgServer(new String[]{
"-pgAllowOthers", "true"}).start();
Parameters: args - the server |
createTcpServer | public static Server createTcpServer(String[] args) throws SQLException(Code) | | Create a new TCP server, but does not start it yet. Example:
Server server = Server.createTcpServer(
new String[] { "-tcpAllowOthers", "true" }).start();
Parameters: args - the server |
createWebServer | public static Server createWebServer(String[] args) throws SQLException(Code) | | Create a new web server, but does not start it yet. Example:
Server server = Server.createWebServer(
new String[] { "-log", "true" }).start();
Parameters: args - the server |
getService | public Service getService()(Code) | | Get the service attached to this server.
the service |
getURL | public String getURL()(Code) | | Gets the URL of this server.
the url |
isRunning | public boolean isRunning()(Code) | | Checks if the server is running.
if the server is running |
main | public static void main(String[] args) throws SQLException(Code) | | The command line interface for this tool. The options must be split into
strings like this: "-baseDir", "/temp/data",... By default, -tcp, -web,
-browser and -pg are started. If there is a problem starting a service,
the program terminates with an exit code of 1. Options are case
sensitive. The following options are supported:
- -help or -? (print the list of options)
- -web (start the Web Server and H2 Console)
- -tcp (start the TCP Server)
- -tcpShutdown {url} (shutdown the running TCP Server,
URL example: tcp://localhost:9094)
- -pg (start the PG Server)
- -browser (start a browser and open a page to connect to the
Web Server)
- -log {true|false} (enable or disable logging, for all servers)
- -baseDir {directory} (sets the base directory for H2 databases,
for all servers)
- -ifExists {true|false} (only existing databases may be opened,
for all servers)
- -ftp (start the FTP Server)
For each Server, additional options are available:
- -webPort {port} (the port of Web Server, default: 8082)
- -webSSL {true|false} (if SSL should be used)
- -webAllowOthers {true|false} (enable/disable remote connections)
- -tcpPort {port} (the port of TCP Server, default: 9092)
- -tcpSSL {true|false} (if SSL should be used)
- -tcpAllowOthers {true|false} (enable/disable remote connections)
- -tcpPassword {password} (the password for shutting down a TCP
Server)
- -tcpShutdownForce {true|false} (don't wait for other connections to
close)
- -pgPort {port} (the port of PG Server, default: 5435)
- -pgAllowOthers {true|false} (enable/disable remote connections)
- -ftpPort {port}
- -ftpDir {directory}
- -ftpRead {readUserName}
- -ftpWrite {writeUserName}
- -ftpWritePassword {password}
Parameters: args - the command line arguments throws: SQLException - |
run | public void run()(Code) | | INTERNAL
|
shutdown | public void shutdown()(Code) | | INTERNAL
|
shutdownTcpServer | public static void shutdownTcpServer(String url, String password, boolean force) throws SQLException(Code) | | Shutdown a TCP server. If force is set to false, the server will not
allow new connections, but not kill existing connections, instead it will
stop if the last connection is closed. If force is set to true, existing
connections are killed. After calling the method with force=false, it is
not possible to call it again with force=true because new connections are
not allowed. Example:
Server.shutdownTcpServer("tcp://localhost:9094", password, true);
Parameters: url - example: tcp://localhost:9094 Parameters: password - the password to use ("" for no password) Parameters: force - the shutdown (don't wait) throws: ClassNotFoundException - throws: SQLException - |
stop | public void stop()(Code) | | Stops the server.
|
|
|