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

 

Using the NetworkServerControl API

You need to create an instance of the NetworkServerControl class if you are using the API. There are four constructors for this class:

Note: Before enabling connections from other systems, ensure that you are running under a security manager.
  • NetworkServerControl()

    This constructor creates an instance that listens either on the default port (1527) or the port that is set by the derby.drda.portNumber property. It will also listen on the host set by the derby.drda.host property or the loopback address if the property is not set. This is the default constructor; it does not allow remote connections. It is equivalent to calling NetworkServerControl(InetAddress.getByName("localhost"),1527) if no properties are set.

  • NetworkServerControl(InetAddress address, int portNumber)
    This constructor creates an instance that listens on the specified portNumber on the specified address. The InetAddress will be passed to ServerSocket. NULL is an invalid address value. The following examples show how you might allow Network Server to accept connections from other hosts:
    //accepts connections from other hosts on an IPv4 system
    NetworkServerControl serverControl = 
      new NetworkServerControl(InetAddress.getByName("0.0.0.0"),1527);
    //accepts connections from other hosts on an IPV6 system
    NetworkServerControl serverControl = 
      new NetworkServerControl(InetAddress.getByName("::"),1527);
  • NetworkServerControl(String userName, String password)

    If a network server should run with user authentication, certain operations like NetworkServerControl.shutdown() require that you provide user credentials. This constructor creates an instance with user credentials, which are then used for operations that require them. In all other aspects, this constructor behaves like NetworkServerControl().

  • NetworkServerControl(InetAddress address, int portNumber, String userName, String password)

    This constructor creates an instance with user credentials, which are then used for operations that require them. In all other aspects, this constructor behaves like NetworkServerControl(InetAddress address, int portNumber).

 

javadb@jdbcurl.com