Re: Can I check if a db connection is working?

From: "Chris White" <cjwhite(at)cisco(dot)com>
To: "'Jacob Vennervald Madsen'" <jvm(at)gopinocchio(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Can I check if a db connection is working?
Date: 2002-08-09 15:58:50
Message-ID: 000001c23fbd$a836d5d0$ff926b80@amer.cisco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Use the Connection.isClosed() method, according to the code comments, this
will test the connection for you.

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Jacob Vennervald
Madsen
Sent: Tuesday, August 06, 2002 8:10 AM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] Can I check if a db connection is working?

Hi List

I have a database handler with a persistent connection to a Postgres
database.
The problem is that if the TCP/IP connection between the database and the
application is temporaryly down then I have to restart my application
afterwards to reestablish the connection. This happens for example when the
database is restarted with mode fast.
Is there any way to check if the database connection is working before using
it?

Best regards,
Jacob Vennervald Madsen
Systems Developer

GoPinocchio
Norrebrogade 45
DK-2200 Copenhagen
www.gopinocchio.com
+45 26750106

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jon Swinth 2002-08-09 19:04:58 Problem with getBytes and TIME
Previous Message Håkon Hansen 2002-08-09 07:32:28 Re: Problem with JDBCRealm in Tomcat