Para verificar se o Network Server do Derby est?? executando no momento, ?? utilizado o comando ping.
O comando ping pode ser utilizado das seguintes maneiras:
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; }