Skip to main content

Getting Started using Derby with Glassfish and SJSAS 8.2

Posted by lancea on February 7, 2006 at 11:10 AM PST

Glassfish and SJSAS 8.2 introduce two new asadmin commands for starting and stopping the Derby Network Server.

The start-database command may be used to start an instance of the Derby network server:

start-database [––dbhost 0.0.0.0] [––dbport 1527] [––dbhome install_dir/derby]

The default value for the host is 0.0.0.0, which allows for Derby to listen on localhost as well as the ip/hostname interfaces.

The value for the dbhome property represents the location of where the derby databases reside. The default is /derby.

You may also use the asadmin command stop-database to shutdown an instance of the Derby network server that is running:

stop-database [––dbhost 0.0.0.0] [––dbport 1527]

The derby configuration that ships with glassfish and SJSAS 8.2 also provides several useful scripts which can assist you with utilizing Derby successfully.

To run these scripts, you need to do the following:

  • set the environment variable DERBY_INSTALL to point to the /derby directory
  • unset your CLASSPATH environment variable

You may also optionally set the following properties:


  • DERBY_SERVER_HOST the host that the network server will listen on (may also be set to 0.0.0.0 to enable all listeners)
  • DERBY_SERVER_PORT the port number for the network server to listen on

The following scripts are available for use in the /derby/frameworks/NetworkServer/bin directory:

  • startNetworkServer.ksh/bat - Script to start the network server
  • stopNetworkServer.ksh/bat - Script to stop the network server
  • ij.ksh/bat - interactive JDBC scripting tool
  • dblook.ksh/bat - Script to view all or part of the DDL for a database
  • sysinfo.ksh/bat - Script to display versioning info regarding the derby environment
  • NetworkServerControl.ksh/bat - Script which provides a means of executing commands on the NetworkServerControl API.

For more information, see the Derby tools and admin guide for additional details on these utilities