Open a command prompt and change directories to the %%\demo\nserverdemo
directory, where %%
is the directory where you installed .Set the classpath to include the current directory ("."), and the
following jar files:
derbynet.jar
The Network Server jar file. It must be in your CLASSPATH because you
start the Network Server in this program.
derby.jar
The database engine jar file.
derbytools.jar
The tools jar
file.
Test the CLASSPATH settings by running the following Java command:
java org.apache.derby.tools.sysinfoThis command displays the jar
files that are in the classpath.After you set up your environment correctly, run the SimpleNetworkServerSample
program from the same directory: java SimpleNetworkServerSampleIf the program runs successfully, you will receive output that
is similar to that shown in the following exampleS: Starting Network Server
Testing if Network Server is up and running!
Network Server now running
Got an embedded connection.
Testing embedded connection by executing a sample query
number of rows in sys.systables = 16
While my app is busy with embedded work, ij might connect like this:
$ java -Dij.user=me -Dij.password=pw -Dij.protocol=
jdbc:derby:\\localhost:1527\ org.apache.derby.tools.ij
ij> connect 'NSSimpleDB';
Clients can continue to connect:
Press [Enter] to stop Server
Running the SimpleNetworkServerSample program also creates the
following new directories and files:
NSSimpleDB
This directory makes up the NSSimpleDB database.
derby.log
This log file contains progress
and error messages.