From the command line, you can shut down a Network Server by invoking a jar file or a class.
Note that you need to provide user credential arguments to shut down a server running with user authentication.
java -jar derbyrun.jar server shutdown [-h <hostname>] [-p <portnumber>] [-user <username>] [-password <password>]
java -jar derbynet.jar shutdown [-h <hostname>] [-p <portnumber>] [-user <username>] [-password <password>]
java org.apache.derby.drda.NetworkServerControl shutdown [-h <hostname>] [-p <portnumber>] [-user <username>] [-password <password>]