ServerThis tool can be used to start various database servers (listeners).
static Server createFtpServer(String[] args) throws SQLExceptionCreate a new ftp server, but does not start it yet. Example:Server server = Server.createFtpServer( new String[] { "-trace" }).start(); Parameters:
args -
Returns:
the server
static Server createPgServer(String[] args) throws SQLExceptionCreate a new PG server, but does not start it yet. Example:Server server = Server.createPgServer(new String[]{ "-pgAllowOthers"}).start(); Parameters:
args -
Returns:
the server
static Server createTcpServer(String[] args) throws SQLExceptionCreate a new TCP server, but does not start it yet. Example:Server server = Server.createTcpServer( new String[] { "-tcpAllowOthers" }).start(); Parameters:
args -
Returns:
the server
static Server createWebServer(String[] args) throws SQLExceptionCreate a new web server, but does not start it yet. Example:Server server = Server.createWebServer( new String[] { "-trace" }).start(); Parameters:
args -
Returns:
the server
Service getService()Get the service attached to this server.Returns:
the service
String getURL()Gets the URL of this server.Returns:
the url
boolean isRunning(boolean traceError)Checks if the server is running.Parameters:
traceError - if errors should be written
Returns:
if the server is running
static void main(String[] args) throws SQLExceptionThe 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:
Parameters:
args - the command line arguments
Throws:
SQLException
static void shutdownTcpServer(String url, String password, boolean force) throws SQLExceptionShutdown 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
password - the password to use ("" for no password)
force - the shutdown (don't wait)
Throws:
ClassNotFoundException
SQLException
Server start() throws SQLExceptionTries to start the server.Returns:
the server if successful
Throws:
SQLException - if the server could not be started
static void startWebServer(Connection conn) throws SQLExceptionStart 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.Parameters:
conn - the database connection (the database must be open)
void stop()Stops the server. |