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.
If necessary, notify users that the database is being stopped.
Stop the database by using the stop-database(1) subcommand.
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 - 10.2.2.1 - (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 = 0.0.0.0, 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
You can also view the full syntax and options of the subcommand by typing asadmin help stop-database at the command line.