Running the SimpleNetworkClientSample program

To connect to the Network Server that has been started with the SimpleNetworkServerSample program, follow these steps.

  1. Open a command prompt and change directories to the %DERBY_HOME%\demo\nserverdemo directory, where %DERBY_HOME% is the directory where you installed Derby.
  2. Set the classpath to include the following jar files:
    • The current directory (".")
    • derbyclient.jar
  3. After you set up your environment correctly, run the SimpleNetworkClientSample program from the same directory:
    java SimpleNetworkClientSample
    If the program runs successfully, you will receive output similar to that shown in the following example:
    Starting Sample client program
    Got a client connection via the DriverManager.
    connection from datasource; getDriverName = Apache Derby Network Client JDBC Driver
    Got a client connection via a DataSource.
    Testing the connection obtained via DriverManager by executing a sample query
    number of rows in sys.systables = 23
    Testing the connection obtained via a DataSource by executing a sample query
    number of rows in sys.systables = 23
    Goodbye!
  4. After running the program, return to the command prompt where you ran the SimpleNetworkServerSample program and press Enter.
Related concepts
Overview of the SimpleNetworkServerSample program
Connecting a client to the Network Server with the SimpleNetworkClientSample program
Related tasks
Running the SimpleNetworkServerSample program