This section provides instructions for using the Java DB database implementation bundled with Enterprise Server 2.1. Java DB is based on the Apache Derby database.
Sun GlassFish Enterprise Server has the following asadmin commands for starting and stopping the Java DB Network Server.
Use the asadmin start-database command to start an instance of the Java DB network server:
asadmin start-database [--dbhost 0.0.0.0] [--dbport 1527] [--dbhome path]
The default value for the host is 0.0.0.0, which enables Java DB to listen on localhost as well as the IP/hostname interfaces. The value for the dbhome property is the location of where the Java DB databases reside. The default path is as-install/javadb.
Use the asadmin stop-database command to shut down a running instance of the Java DB network server:
asadmin stop-database [--dbhost 0.0.0.0] [--dbport 1527]
The Java DB configuration that is supplied with Enterprise Server 2.1 includes scripts that can help you use Java DB. The following scripts are available for use in the as-install/javadb/bin directory:
startNetworkServer, startNetworkServer.bat— Script to start the network server
stopNetworkServer, stopNetworkServer.bat— Script to stop the network server
ij, ij.bat— Interactive JDBC scripting tool
dblook, dblook.bat — Script to view all or part of the DDL for a database
sysinfo, sysinfo.bat — Script to display versioning information about the Java DB environment
NetworkServerControl, NetworkServerControl.bat — Script which provides a means of executing commands on the NetworkServerControl API
Ensure that the JAVA_HOME environment variable specifies the directory where the JDK is installed.
Set the DERBY_HOME environment variable to point to the as-install/javadb directory.
For more information about these utilities, see the following Derby documentation: