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:

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;
}
Related concepts
Overview of Derby Network Server management
Related tasks
Setting Network Server properties