background image
<< Using the Network Server | Commands to invoke the Derby jar files >>

Starting the Network Server

<< Using the Network Server | Commands to invoke the Derby jar files >>
Derby Server and Administration Guide
15
This jar file contains the Derby Network Client JDBC driver that is necessary
for communication with the Network Server. It must be in the classpath of the
application on the client side in order to access Derby databases over a network.
All of the jar files are in the
$DERBY_HOME/lib
directory.
Derby provides script files for setting the classpath to work with the Network Server. The
scripts are located in the
$DERBY_HOME/bin
directory.
·
setNetworkClientCP.bat
(Windows)
·
setNetworkClientCP
(UNIX)
·
setNetworkServerCP.bat
(Windows)
·
setNetworkServerCP
(UNIX)
See
Managing the Derby Network Server
and Getting Started with Derby for more
information on setting the classpath.
Starting the Network Server
To start the Network Server, you can invoke a script, a jar file, or a class.
> Important: Note that you should always properly shut down the Network Server after
use, because failure to do so might result in unpredictable side-effects, such as blocked
ports on the server.
You are strongly urged to enable user authentication and user authorization when you
run a Network Server. For details on how to configure user authentication, see "Working
with user authentication" in the Derby Developer's Guide. For information on user
authorization, see "Users and authorization identifiers" and "User authorizations" in the
Derby Developer's Guide. You are also urged to install a Java security manager with a
customized security policy. For details on how to do this, see
Customizing the Network
Server's security policy
.
You can start the Network Server in any of the following ways:
· If you are relatively new to the Java programming language, follow the
instructions in "Setting up your environment" in Getting Started with Derby
to set the
DERBY_HOME
and
JAVA_HOME
environment variables and to add
DERBY_HOME/bin
to your path. Then use the
startNetworkServer.bat
script
to start the Network Server on Windows machines and the
startNetworkServer
script to start the Network Server on UNIX systems. These scripts are located in
$DERBY_HOME/bin
, where
$DERBY_HOME
is the directory where you installed
Derby.
You can run NetworkServerControl commands only from the host that started the
Network Server. The following table shows the sequence of commands.
Table 1.
Commands to run the
startNetworkServer
command
Operating
System
Command
Windows
set DERBY_HOME=C:\derby
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_24
set PATH=%DERBY_HOME%\bin;%PATH%
startNetworkServer
UNIX (Korn Shell)
export DERBY_HOME=/opt/derby
export JAVA_HOME=/usr/j2se
export PATH="$DERBY_HOME/bin:$PATH"
startNetworkServer