Sun GlassFish Enterprise Server v3 Administration Guide

ProcedureTo Stop the Database

Use the local stop-database subcommand to stop Java DB on a specified port. A single host can have multiple database server processes running on different ports.

  1. If necessary, notify users that the database is being stopped.

  2. Stop the database by using the stop-database(1) subcommand.

Example 14–2 Stopping a Database

This example stops Java DB on port 5001 of localhost.

asadmin> stop-database --dbhost=localhost --dbport=5001
onnection obtained for host: localhost, port number 5001.
Apache Derby Network Server - - (538595) shutdown 
at 2008-10-17 23:34:2 7.218 GMT
Command stop-database executed successfully.


For a laptop that roams between networks, you might have trouble shutting down the database. If you start Java DB and then change your IP address, you will not be able to stop Java DB unless you add a specific --dbhost argument. For example, if you run asadmin start-database --dbhost =, and then disconnect Ethernet and switch to wifi, you should run a command similar to the following to stop the database:

asadmin stop-database --dbhost localhost

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help stop-database at the command line.