|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.server.TcpServer
public class TcpServer
The TCP server implements the native H2 database server protocol. It supports multiple client connections to multiple databases (many to many). The same database may be opened by multiple clients. Also supported is the mixed mode: opening databases in embedded mode, and at the same time start a TCP server to allow clients to connect to the same database over the network.
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default port to use for the TCP server. |
Constructor Summary | |
---|---|
TcpServer()
|
Method Summary | |
---|---|
java.lang.String |
checkKeyAndGetDatabaseName(java.lang.String db)
If no key is set, return the original database name. |
boolean |
getAllowOthers()
Check if remote connections are allowed. |
static java.lang.String |
getManagementDbName(int port)
Get the database name of the management database. |
java.lang.String |
getName()
Get the human readable name of the service. |
int |
getPort()
Gets the port this service is listening on. |
java.lang.String |
getType()
Get the human readable short name of the service. |
java.lang.String |
getURL()
Get the URL of this service in a human readable form |
void |
init(java.lang.String... args)
Initialize the service from command line options. |
boolean |
isRunning(boolean traceError)
Check if the service is running. |
void |
listen()
Listen for incoming connections. |
static void |
shutdown(java.lang.String url,
java.lang.String password,
boolean force)
Stop the TCP server with the given URL. |
void |
start()
Start the service. |
void |
stop()
Stop the service. |
static void |
stopServer(int port,
java.lang.String password,
int shutdownMode)
Stop a running server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
Constructor Detail |
---|
public TcpServer()
Method Detail |
---|
public static java.lang.String getManagementDbName(int port)
port
- the TCP server port
public void init(java.lang.String... args)
Service
init
in interface Service
args
- the command line optionspublic java.lang.String getURL()
Service
getURL
in interface Service
public int getPort()
Service
getPort
in interface Service
public void start() throws java.sql.SQLException
Service
start
in interface Service
java.sql.SQLException
public void listen()
Service
listen
in interface Service
public boolean isRunning(boolean traceError)
Service
isRunning
in interface Service
traceError
- if errors should be written
public void stop()
Service
stop
in interface Service
public static void stopServer(int port, java.lang.String password, int shutdownMode)
port
- the port where the server runspassword
- the passwordshutdownMode
- the shutdown mode, SHUTDOWN_NORMAL or SHUTDOWN_FORCE.public boolean getAllowOthers()
Service
getAllowOthers
in interface Service
public java.lang.String getType()
Service
getType
in interface Service
public java.lang.String getName()
Service
getName
in interface Service
public static void shutdown(java.lang.String url, java.lang.String password, boolean force) throws java.sql.SQLException
url
- the database URLpassword
- the passwordforce
- if the server should be stopped immediately
java.sql.SQLException
public java.lang.String checkKeyAndGetDatabaseName(java.lang.String db) throws java.sql.SQLException
db
- the key to test (or database name if no key is used)
java.sql.SQLException
- if a key is set but doesn't match
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |