background image
<< Obtaining system information | Accessing the Network Server >>

Obtaining Network Server runtime information

<< Obtaining system information | Accessing the Network Server >>
Derby Server and Administration Guide
19
You can also use Java Management Extensions (JMX) technology to obtain system
information. For details, visit the wiki page
http://wiki.apache.org/db-derby/DerbyJMX
and refer to the API documentation for the packages
org.apache.derby.mbeans
and
org.apache.derby.mbeans.drda
. For information on JMX technology, see
http://download.oracle.com/javase/6/docs/technotes/guides/jmx/
.
Obtaining system information by using the command line
To run
sysinfo
from the command line, use a command like one of the following while
the Network Server is running:
java -jar $DERBY_HOME/lib/derbyrun.jar server sysinfo
[-h hostname][-p portnumber]
java org.apache.derby.drda.NetworkServerControl sysinfo
[-h hostname][-p portnumber]
Administrative commands such as
sysinfo
can only execute on the host where the
server was started, even if the server was started with the
-h
option.
Obtaining system information by using the API
The
sysinfo
method produces the same information as the sysinfo command. The
signature for this method is
String getSysinfo();
For example:
NetworkServerControl serverControl = new NetworkServerControl();
String myinfo = serverControl.getSysinfo();
The
getSysinfo()
method returns information about the Network Server that is
running on the current machine on the default port number (1527).
Obtaining Network Server runtime information:
Use the runtimeinfo command or getRuntimeInfo method to get memory usage and
current session information about the Network Server including user, database, and
prepared statement information.
· To run runtimeinfo from the command line:
java org.apache.derby.drda.NetworkServerControl runtimeinfo
[-h <hostname>][<-p portnumber>]
· The getRuntimeInfo method returns the same information as the runtimeinfo
command. The signature for the getRuntimeInfo method is String getRuntimeInfo().
For example:
NetworkServerControl serverControl = new NetworkServerControl();
String myinfo = serverControl.getRuntimeInfo();
Obtaining Network Server properties by using the getCurrent Properties
method:
The getCurrentProperties method is a Java method that you can use to obtain
information about the Network Server. It returns a Properties object with the value of all
the Network Server properties as they are currently set.
The signature of this method is:
Properties getCurrentProperties();
For example:
NetworkServerControl server = new NetworkServerControl();