background image
<< Starting a server which authenticates clients | Controlling logging by using the log file >>

Network Server handling connections

<< Starting a server which authenticates clients | Controlling logging by using the log file >>
Derby Server and Administration Guide
51
Running the client when both parties do peer authentication
This is a combination of the two last variants.
Example
System.setProperty("javax.net.ssl.keyStore","clientKeyStore.key");
System.setProperty("javax.net.ssl.keyStorePassword","qwerty");

System.setProperty("javax.net.ssl.trustStore","clientTrustStore.key");
System.setProperty("javax.net.ssl.trustStorePassword","qwerty");
Connection c =

getConnection("jdbc:derby://myhost:1527/db;ssl=peerAuthentication");
Other server commands
The other server commands (
shutdown
,
ping
,
sysinfo
,
runtimeinfo
,
logconnections
,
maxthreads
,
timeslice
,
trace
,
tracedirectory
) are
implemented as
clients
, and they behave exactly as clients with regards to SSL. The SSL
mode is set with the property
derby.drda.sslMode
or the server command option
-ssl
.
Examples
java -jar derbyrun.jar server shutdown -ssl basic
will shut down an SSL-enabled server.
Similarly, if you have
peerAuthentication
on both sides, use the following command:
java -Djavax.net.ssl.keyStore=clientKeyStore.key \
-Djavax.net.ssl.keyStorePassword=qwerty \
-Djavax.net.ssl.trustStore=clientTrustStore.key \
-Djavax.net.ssl.trustStorePassword=qwerty \
-jar derbyrun.jar server shutdown -ssl peerAuthentication
Configuring the Network Server to handle connections
You can configure the Network Server to use a specific number of threads to handle
connections. You can change the configuration on the command line or by using the
servlet interface.
The minimum number of threads is the number of threads that are started
when the Network Server is booted. This value is specified as a property,
derby.drda.minThreads = <min>
. The maximum number of threads is the
maximum number of threads that will be used for connections. If more connections are
active than there are threads available, the extra connections must wait until the next
thread becomes available. Threads can become available after a specified time, which is
checked only when a thread has finished processing a communication.
· You can change the maximum number of threads by using the following command:
java org.apache.derby.drda.NetworkServerControl maxthreads <max> [-h
<hostname>]
[-p <portnumber>]
You can also use the
derby.drda.maxThreads
property to assign the maximum
value. A <max> value of 0 means that there is no maximum and a new thread will
be generated for a connection if there are no current threads available. This is the
default. The <max> and <min> values are stored as integers, so the theoretical
maximum is 2147483647 (the maximum size of an integer). But the practical
maximum is determined by the machine configuration.