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 SimpleNetworkServerSample program

To run the Derby Network Server sample program:

  1. Open a command prompt and change directories to the %DERBY_HOME%\demo\nserverdemo directory, where %DERBY_HOME% is the directory where you installed Derby.
  2. Set the classpath to include the current directory ("."), and the following jar files:
    derbynet.jar
    The Network Server jar file. It must be in your CLASSPATH because you start the Network Server in this program.
    derby.jar
    The database engine jar file.
    derbytools.jar
    The Derby tools jar file.
  3. Test the CLASSPATH settings by running the following Java command:
    java org.apache.derby.tools.sysinfo
    This command displays the Derby jar files that are in the classpath.
  4. After you set up your environment correctly, run the SimpleNetworkServerSample program from the same directory:
    java SimpleNetworkServerSample
    If the program runs successfully, you will receive output that is similar to that shown in the following exampleS:
    Starting Network Server
    Testing if Network Server is up and running!
    Derby Network Server now running
    Got an embedded connection.
    Testing embedded connection by executing a sample query
    number of rows in sys.systables = 16
    While my app is busy with embedded work, ij might connect like this:
    
            $ java -Dij.user=me -Dij.password=pw -Dij.protocol=
    			jdbc:derby:\\localhost:1527\ org.apache.derby.tools.ij
            ij> connect 'NSSimpleDB';
    
    Clients can continue to connect:
    Press [Enter] to stop Server
Running the SimpleNetworkServerSample program also creates the following new directories and files:
NSSimpleDB
This directory makes up the NSSimpleDB database.
derby.log
This log file contains Derby progress and error messages.
 

javadb@jdbcurl.com