You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Hiller, Frank RD-AS2" <Fr...@heidelberg.com> on 2005/08/19 08:06:03 UTC

How to check if database is available

Hello OJB users,
 
how can one check via OJB whether the database is avaialable before
establishing a connection to it?
 
Thanks,
Frank
 


Confidentiality note:
The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.

Re: How to check if database is available

Posted by Thomas Dudziak <to...@gmail.com>.
On 8/19/05, Hiller, Frank RD-AS2 <Fr...@heidelberg.com> wrote:

> how can one check via OJB whether the database is avaialable before
> establishing a connection to it?

I think that in JDBC you'd have to try to establish a connection to it
and if that fails, then likely the database is not available (for
whatever reason). AFAIK there is no other generic way (though
individual databases may provide other means).
Since OJB builds upon JDBC, you probably got to try to establish a
connection and execute the query that you've defined as the keep-alive
query, and see whether this is possible.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org