How can I check from Java is MySQL / LDAP is running or not?
+1
A:
Simply attempt a connection. In case the target servers aren't running, you will get, and catch an exception indicating this.
If you then don't want to use the connection, if successful, close()
it.
Bozho
2010-03-11 14:48:35
was thinking of the same, but is that the right way to test the connection?
Panther24
2010-03-11 16:17:08
Yes. (15 chars)
Bozho
2010-03-11 16:20:04