From: Pedro Mendes <peter_mendes@clix.pt>
To: pgsql-jdbc@postgresql.org
Subject: Problem getting a connection with Postgres 8.0.3
Date: Wed, 28 Sep 2005 23:11:11 +0100
Message-ID: <20050928221108.ADEC4D9AAA@svr1.postgresql.org> (raw)
Hello,
I'm having some problems connecting my jsp application using driver
postgresql-8.0-312.jdbc3 to a local postgresql database server. The
connection seems to be always refused whatever the user and/or database.
This is the code I wrote:
try
{
Class.forName("org.postgresql.Driver");
Connection db =
DriverManager.getConnection("jdbc:postgresql://192.168.8.2/cgm","cgm","esper
anca");
for( SQLWarning warn = db.getWarnings(); warn != null; warn =
warn.getNextWarning() )
{
System.out.println( "SQL
Warning:" ) ;
System.out.println( "State
: " + warn.getSQLState() ) ;
System.out.println(
"Message: " + warn.getMessage() ) ;
System.out.println( "Error
: " + warn.getErrorCode() ) ;
}
..
This is the error returned:
Message: Connection refused. Check that the hostname and port are correct
and that the postmaster is accepting TCP/IP connections.
Error : 0
Hopping for an answer
Pedro Mendes - Portugal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: peter_mendes@clix.pt
Subject: Re: Problem getting a connection with Postgres 8.0.3
In-Reply-To: <20050928221108.ADEC4D9AAA@svr1.postgresql.org>
References: <20050928221108.ADEC4D9AAA@svr1.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox