Stops a running H2 database server.


asadmin [asadmin-options] stop-database [--help]
[--dbuser db-user]
[--dbhost host] [--dbport port-no]


The stop-database subcommand stops a running H2 database server process. The database is typically started with the start-database subcommand. A single host can have multiple database server processes running on different ports. The stop-database subcommand stops the database server process for the specified port only.

This subcommand is supported in local mode only.



Options for the asadmin utility. For information about these options, see the asadmin help page.


Displays the help text for the subcommand.


The username of the Java DB user that is to stop the server process. If this option is omitted, no user is specified.


The host name or IP address of the Java DB server process. The default is the IP address, which denotes all network interfaces on the host where you run the stop-database subcommand.


The port number where the H2 database server listens for client connections.


Example 1 Stopping Java DB

This example stops Java DB on host host1 and port 5001.

asadmin> stop-database --dbhost host1 --dbport 5001

Command stop-database executed successfully.

Exit Status

The exit status applies to errors in executing the asadmin utility. For information on database errors, see the h2.log file. This file is located in the directory you specify by using the --dbhome option when you run the start-database subcommand.

If you did not specify --dbhome, the value of H2_INSTALL defaults to as-install/h2.


command executed successfully


error in executing the command

See Also