Description: To verify that the Derby Network Server is currently running, use the ping command.
Keywords: Network Server, verifying startup

# Verifying Startup

To verify that the Derby Network Server is currently running, use the ping command.

You can use the ping command in the following ways:

- You can use the scripts NetworkServerControl.bat for Windows systems or NetworkServerControl.ksh for UNIX systems with the ping command. For example:

      NetworkServerControl ping [-h <hostname>;] [-p <portnumber>]

- You can use the NetworkServerControl command:

      java org.apache.derby.drda.NetworkServerControl
         ping [-h <hostname>] [-p <portnumber>]

- You can use the NetworkServerControl API to verify startup from within a Java application:

      ping();

The following example uses a method to verify startup. It will try to verify for the specified number of seconds:

    private static boolean isServerStarted(NetworkServerControl server, int ntries)
    	{
    		for (int i = 1; i <= ntries; i ++)
    		{
    			try {
    				Thread.sleep(500);
    				server.ping();
    				return true;
    			}
    			catch (Exception e) {
    				if (i == ntries)
    					return false;
    			}
    		}
    		return false;
    	}

Parent topic: Managing the Derby Network Server
Related concepts
Overview
Related tasks
Setting Network Server properties