background image
<< derby.drda.timeSlice property | Start-up page >>

Verifying Startup

<< derby.drda.timeSlice property | Start-up page >>
Derby Server and Administration Guide
40
Default
If the derby.system.home property has been set, it is the default. Otherwise, the default is
the current directory.
Example
derby.drda.traceDirectory=c:/Derby/trace
Static or dynamic
Dynamic. System values can be changed by using commands or the servlet interface
after the Network Server has been started.
Verifying Startup
To verify that the Derby Network Server is currently running, use the ping command.
You can use the ping command in the following ways:
· You can use the scripts NetworkServerControl.bat for Windows systems or
NetworkServerControl.ksh for UNIX systems with the ping command. For example:
NetworkServerControl ping [-h <hostname>;] [-p <portnumber>]
· You can use the NetworkServerControl command:
java org.apache.derby.drda.NetworkServerControl
ping [-h <hostname>] [-p <portnumber>]
· You can use the NetworkServerControl API to verify startup from within a Java
application:
ping();
The following example uses a method to verify startup. It will try to verify for the specified
number of seconds:
private static boolean isServerStarted(NetworkServerControl server, int
ntries)
{
for (int i = 1; i <= ntries; i ++)
{
try {
Thread.sleep(500);
server.ping();
return true;
}
catch (Exception e) {
if (i == ntries)
return false;
}
}
return false;
}
Managing the Derby Network Server remotely by using the servlet
interface
You can use the servlet interface to manage the Network Server remotely. To use
the servlet interface, the servlet must be registered with an Application Server, and
derby.system.home must be known to the Application Server.
A Web application archive (WAR) file, derby.war, for the Derby Network Server is
available in $DERBY_HOME/lib. This file registers the Network Server's servlet at the