Java DB

Apache Derby

Derby Server and Administration Guide

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Server and Admin Guide
-Part one: Derby Server Guide
-Derby in a multi-user environment
-Using the Network Server with preexisting Derby applications
-The Network Server and JVMs
-Installing required jar files and adding them to the classpath
-Starting the Network Server
-Shutting down the Network Server
-Obtaining system information
-Accessing the Network Server by using the network client driver
-Accessing the Network Server by using a DataSource object
-XA and the Network Server
-Using the Derby tools with the Network Server
-Differences between running Derby in embedded mode and using the Network Server
-Setting port numbers
-Managing the Derby Network Server
-Managing the Derby Network Server remotely by using the servlet interface
-Derby Network Server advanced topics
-Derby Network Server sample programs
-Part two: Derby Administration Guide
-Checking database consistency
-Backing up and restoring databases
-Replicating databases
-Logging on a separate device
-Obtaining locking information
-Reclaiming unused space

 

Running the client with SSL/TLS

Basic SSL encryption on the client is enabled either by the URL attribute ssl, the property ssl or the datasource attribute ssl set to basic.

Example:

Connection c = 
   getConnection("jdbc:derby://myhost:1527/db;ssl=basic");

Running a client which authenticates the server

If the client wants to authenticate the server, then the client's trust store must contain the server's certificate. See Key and certificate handling.

Client SSL with server authentication is enabled by the URL attribute ssl or the property ssl set to peerAuthentication. In addition, the system properties javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword need to be set.

Example:

    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");

Running the client when the server does client authentication

If the server does client authentication, the client will need a key pair and a client certificate which is installed in the server's trust store, See Key and certificate handling.

The client needs to set javax.net.ssl.keyStore and javax.net.ssl.keyStorePassword.

Example:

    System.setProperty("javax.net.ssl.keyStore","clientKeyStore.key");
    System.setProperty("javax.net.ssl.keyStorePassword","qwerty");
    Connection c = 
       getConnection("jdbc:derby://myhost:1527/db;ssl=basic");

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");
 

javadb@jdbcurl.com