background image
<< Shutting down the Network Server | Obtaining Network Server runtime information >>

Obtaining system information

<< Shutting down the Network Server | Obtaining Network Server runtime information >>
Derby Server and Administration Guide
18
Shutting down by using the command line
From the command line, you can shut down a Network Server by invoking a jar file or a
class.
Note that you need to provide user credential arguments to shut down a server running
with user authentication.
· To shut down the Network Server by invoking a jar file from the
$DERBY_HOME/lib
directory, use:
java -jar derbyrun.jar server shutdown [-h <hostname>] [-p
<portnumber>] [-user <username>] [-password <password>]
or
java -jar derbynet.jar shutdown [-h <hostname>] [-p <portnumber>]
[-user <username>] [-password <password>]
· To shut down the Network Server by invoking a class, use:
java org.apache.derby.drda.NetworkServerControl shutdown [-h
<hostname>] [-p <portnumber>] [-user <username>] [-password
<password>]
Shutting down by using the API
You can use the NetworkServerControl API to shut down the Network Server from within
a Java application. The name of the method that you use to shutdown the Network
Server is
shutdown()
.
For example, the following command shuts down the Network Server running on the
current machine using the default port number (1527):
NetworkServerControl server = new NetworkServerControl();
server.shutdown();
To shut down a server running with user authentication, you need to use a
NetworkServerControl instance created with user credentials:
NetworkServerControl server = new NetworkServerControl(username,
password);
server.shutdown();
Obtaining system information
You can obtain information about the Network Server, such as version and current
property values, Java information, and Derby database server information, by using the
sysinfo
utility. The
sysinfo
utility is available from scripts, the command line, the
NetworkServerControl API, and through the servlet interface.
The following scripts are located in the
$DERBY_HOME/bin
directory. Before running
these scripts, make sure that the Derby Network Server is started.
· Run the following script to obtain information about the Network Server on a
Windows system:
NetworkServerControl.bat sysinfo [-h hostname][-p portnumber]
· Run the following script to obtain information about the Network Server on a UNIX
system:
NetworkServerControl sysinfo [-h hostname] [-p portnumber]
For more information on the
sysinfo
utility, see the Derby Tools and Utilities Guide.