Sun Java System Application Server 

Samples Index

Using the Derby Database with Sample Applications

The Sun Java System Application Server includes the Apache Derby relational database management system (RDBMS), and the Derby Type 4 JDBC driver. Many sample applications use Derby. The Derby database server is installed to install_root/derby/.

For general information on the Derby, see The Apache Derby Project.

This document describes how to use the Derby server with Sun Java System Application Server:

NOTE: In this document, install_dir refers to the the directory where Application Server is installed.

Starting and Stopping Derby

To start the Derby database server, enter the command:

asadmin start-database

This command will start Derby on the local host on the default port, 1527.

The full syntax of the command is:

asadmin start-database [--dbhost=host_name] [--dbport=port_num]

where host_name is the name of the remote host on which to start the database, and port_num is the port number.

Stopping Derby

To stop the server, enter the command:

asadmin stop-database

Creating a Database Connection Pool and a JDBC Resource

To use a Derby database in applications, you must create a connection pool for the database and then create a JDBC resource that points to the connection pool. You can do both of these tasks with asadmin or the Admin Console. For more information, see the chapter "JDBC Resources" in the Application Server Administration Guide.


Copyright © 2006 Sun Microsystems, Inc. All rights reserved.