#42 Boolean function to check connectivity

open
nobody
None
5
2009-05-18
2009-05-18
larsen255
No

Hi,

I couldn´t find an answer how to check the connectivity to a database. I want to it right on startup of my application to show the user an error message if the DB is not available. Also, the program wouldn´t startup any further in that case.

A function "boolean isConnectionPossible()" or something like that would be nice. I tried to use getStartTimeMillis() but that always returns a value even if the DB is stopped.

Is there any workaround?

Lars

Discussion