Re: Simple DB presence verifier.

From: "Damian C" <jamianb(at)gmail(dot)com>
To: Abbas <abbas(at)enterprisedb(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Simple DB presence verifier.
Date: 2007-03-05 19:59:00
Message-ID: 2bbc8f530703051159t6198523fk95eebc41b6dfc500@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Many thanks to John, Abbas and Darkangel for their informative replies.

Initially I will simply establish a socket to port 5432 of the server.
This is trivial to do in Java, quick to succeed (or fail), and
provides appropriate information. Something (notionally) like this
(for future googlers !!!)...
<snip>
try {
InetAddress address = InetAddress.getByName("192.168.1.2");
Socket dbSocket = new Socket(address, 5432);
dbSocket.close();
return true;
} catch (Exception e) {
return false;
}
</snip>

Many thanks,
-Damian

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message WejofOST 2007-03-05 20:04:24 Help with creating Documentation
Previous Message Darkangel Simpson 2007-03-05 17:23:21 Re: Simple DB presence verifier.