type=page
status=published
title=stop-database
next=stop-domain.html
prev=stop-cluster.html
~~~~~~
stop-database
=============

[[stop-database-1]][[GSRFM00239]][[stop-database]]

stop-database
-------------

stops the Java DB

[[sthref2158]]

Synopsis

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

[[sthref2159]]

Description

The `stop-database` subcommand stops a process of the Java DB server.
Java DB server is available for use with \{product---name} and is based
upon Apache Derby. The database is typically started with the
link:start-database.html#start-database-1[`start-database`(1)]
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.

[[sthref2160]]

Options

asadmin-options::
  Options for the `asadmin` utility. For information about these
  options, see the link:asadmin.html#asadmin-1m[`asadmin`(1M)] help page.
`--help`::
`-?`::
  Displays the help text for the subcommand.
`--dbuser`::
  The user name of the Java DB user that is to stop the server process.
  This option is required only when Java DB user authentication is
  enabled. +
  If this option is omitted, no user is specified. By default, Java DB
  user authentication is disabled, so no user or password is required.
`--dbhost`::
  The host name or IP address of the Java DB server process. The default
  is the IP address 0.0.0.0, which denotes all network interfaces on the
  host where you run the `stop-database` subcommand.
`--dbport`::
  The port number where the Java DB server listens for client
  connections. The default is 1527.

[[sthref2161]]

Examples

[[GSRFM765]][[sthref2162]]

Example 1   Stopping Java DB

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

[source,oac_no_warn]
----
asadmin> stop-database --dbhost host1 --dbport 5001
Connection obtained for host: host1, port number 5001.
Shutdown successful.
Command stop-database executed successfully.
----

[[sthref2163]]

Exit Status

The exit status applies to errors in executing the `asadmin` utility.
For information on database errors, see the `derby.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 `DERBY_INSTALL` defaults to
as-install`/javadb`.

0::
  command executed successfully
1::
  error in executing the command

[[sthref2164]]

See Also

link:asadmin.html#asadmin-1m[`asadmin`(1M)]

link:start-database.html#start-database-1[`start-database`(1)]

"link:../administration-guide/jdbc.html#GSADG00015[Administering Database Connectivity]" in GlassFish
Server Open Source Edition Administration Guide


