| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Server | |
| private final Service | |
| private ShutdownHandler | |
| private boolean | |
| private Server | |
| private Server |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Server | Returns: the serverthe argument list args)Create a new PG server, but does not start it yet. |
| public static Server | Returns: the serverthe argument list args)Create a new TCP server, but does not start it yet. |
| public static Server | Returns: the serverthe argument list args)Create a new web server, but does not start it yet. |
| pack-priv static Server | Returns: the serverthe argument list args, String key, or null key, boolean whether creation of databases using the key should be allowed allowSecureCreation)Create a new web server, but does not start it yet. |
| public int | |
| public Service | |
| public String | |
| public String | |
| public boolean | Returns: if the server is runningif errors should be written traceError)Checks if the server is running. |
| public static void | |
| public static void | |
| public void | |
| public void | runTool(String...
the argument list args)Implements abstract org. Run the tool with the given output stream and arguments. |
| public void | |
| public void | |
| public static void | shutdownTcpServer(String
example: tcp://localhost:9094 url, String the password to use ("" for no password) password, boolean the shutdown (don't wait) force, boolean whether all TCP servers that are running in the JVM should be
stopped all)Shutdown one or all TCP server. |
| public Server | |
| public static void | startWebServer(Connection
the database connection (the database must be open) conn)Start a web server and a browser that uses the given connection. |
| public static void | startWebServer(Connection
the database connection (the database must be open) conn, boolean if ignoreProperties)true properties from
.h2.server.properties will be ignoredStart a web server and a browser that uses the given connection. |
| public void | |
| private void | |
| private void | |
| private static void |
| fromCommandLine | back to summary |
|---|---|
| private boolean fromCommandLine | |
| pg | back to summary |
|---|---|
| private Server pg | |
| service | back to summary |
|---|---|
| private final Service service | |
| shutdownHandler | back to summary |
|---|---|
| private ShutdownHandler shutdownHandler | |
| started | back to summary |
|---|---|
| private boolean started | |
| tcp | back to summary |
|---|---|
| private Server tcp | |
| web | back to summary |
|---|---|
| private Server web | |
| Server | back to summary |
|---|---|
| public Server() Generic constructor | |
| Server | back to summary |
|---|---|
| public Server(Service service, String... args) throws SQLException Create a new server for the given service.
| |
| createPgServer | back to summary |
|---|---|
| public static Server createPgServer(String... args) throws SQLException Create a new PG server, but does not start it yet. Example:
Server server =
Server.createPgServer("-pgAllowOthers").start();
Supported options are:
-pgPort, -pgAllowOthers, -pgDaemon,
-trace, -ifExists, -ifNotExists, -baseDir, -key.
See the main method for details.
If no port is specified, the default port is used if possible, and if this port is already used, a random port is used. Use getPort() or getURL() after starting to retrieve the port.
| |
| createTcpServer | back to summary |
|---|---|
| public static Server createTcpServer(String... args) throws SQLException Create a new TCP server, but does not start it yet. Example:
Server server = Server.createTcpServer(
"-tcpPort", "9123", "-tcpAllowOthers").start();
Supported options are:
-tcpPort, -tcpSSL, -tcpPassword, -tcpAllowOthers, -tcpDaemon,
-trace, -ifExists, -ifNotExists, -baseDir, -key.
See the main method for details.
If no port is specified, the default port is used if possible, and if this port is already used, a random port is used. Use getPort() or getURL() after starting to retrieve the port.
| |
| createWebServer | back to summary |
|---|---|
| public static Server createWebServer(String... args) throws SQLException Create a new web server, but does not start it yet. Example:
Server server = Server.createWebServer("-trace").start();
Supported options are:
-webPort, -webSSL, -webAllowOthers, -webDaemon,
-trace, -ifExists, -ifNotExists, -baseDir, -properties.
See the main method for details.
| |
| createWebServer | back to summary |
|---|---|
| pack-priv static Server createWebServer(String[] args, String key, boolean allowSecureCreation) throws SQLException Create a new web server, but does not start it yet. | |
| getPort | back to summary |
|---|---|
| public int getPort() Gets the port this server is listening on.
| |
| getService | back to summary |
|---|---|
| public Service getService() Get the service attached to this server.
| |
| getStatus | back to summary |
|---|---|
| public String getStatus() Get the status of this server.
| |
| getURL | back to summary |
|---|---|
| public String getURL() Gets the URL of this server.
| |
| isRunning | back to summary |
|---|---|
| public boolean isRunning(boolean traceError) Checks if the server is running.
| |
| main | back to summary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void main(String... args) throws SQLException When running without options, -tcp, -web, -browser and -pg are started. Options are case sensitive.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| openBrowser | back to summary |
|---|---|
| public static void openBrowser(String url) throws Exception Open a new browser tab or window with the given URL. | |
| run | back to summary |
|---|---|
| public void run() Implements java. INTERNAL
| |
| runTool | back to summary |
|---|---|
| public void runTool(String... args) throws SQLException Implements abstract org. Doc from org. Run the tool with the given output stream and arguments.
| |
| setShutdownHandler | back to summary |
|---|---|
| public void setShutdownHandler(ShutdownHandler shutdownHandler) INTERNAL
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Implements org. INTERNAL
| |
| shutdownTcpServer | back to summary |
|---|---|
| public static void shutdownTcpServer(String url, String password, boolean force, boolean all) throws SQLException Shutdown one or all 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, false);
| |
| start | back to summary |
|---|---|
| public Server start() throws SQLException Tries to start the server.
| |
| startWebServer | back to summary |
|---|---|
| public static void startWebServer(Connection conn) throws SQLException Start a web server and a browser that uses the given connection. The current transaction is preserved. This is specially useful to manually inspect the database when debugging. This method return as soon as the user has disconnected.
| |
| startWebServer | back to summary |
|---|---|
| public static void startWebServer(Connection conn, boolean ignoreProperties) throws SQLException Start a web server and a browser that uses the given connection. The current transaction is preserved. This is specially useful to manually inspect the database when debugging. This method return as soon as the user has disconnected.
| |
| stop | back to summary |
|---|---|
| public void stop() Stops the server. | |
| stopAll | back to summary |
|---|---|
| private void stopAll() | |
| verifyArgs | back to summary |
|---|---|
| private void verifyArgs(String... args) throws SQLException | |
| wait | back to summary |
|---|---|
| private static void wait(int i) | |