pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedProblem getting a connection with Postgres 8.0.3
3+ messages / 3 participants
[nested] [flat]
* Problem getting a connection with Postgres 8.0.3
@ 2005-09-28 22:11 Pedro Mendes <peter_mendes@clix.pt>
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Mendes @ 2005-09-28 22:11 UTC (permalink / raw)
To: pgsql-jdbc
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Problem getting a connection with Postgres 8.0.3
@ 2005-09-28 22:25 Kris Jurka <books@ejurka.com>
parent: Pedro Mendes <peter_mendes@clix.pt>
0 siblings, 1 reply; 3+ messages in thread
From: Kris Jurka @ 2005-09-28 22:25 UTC (permalink / raw)
To: Pedro Mendes <peter_mendes@clix.pt>; +Cc: pgsql-jdbc
On Wed, 28 Sep 2005, Pedro Mendes wrote:
> 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.
>
> DriverManager.getConnection("jdbc:postgresql://192.168.8.2/cgm","cgm","esper
> anca");
>
> Message: Connection refused. Check that the hostname and port are correct
> and that the postmaster is accepting TCP/IP connections.
>
This is a tcpip error message, caused by the server not listening on the
desired port. What have you set listen_addresses in postgresql.conf?
Probably only localhost. Try adding the server's external address or * to
listen on all available addresses.
Kris Jurka
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Problem getting a connection with Postgres 8.0.3
@ 2005-09-29 00:59 Nelson Arape <narape@ica.luz.ve>
parent: Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 3+ messages in thread
From: Nelson Arape @ 2005-09-29 00:59 UTC (permalink / raw)
To: pgsql-jdbc
El Mié 28 Sep 2005 18:25, Kris Jurka escribió:
> On Wed, 28 Sep 2005, Pedro Mendes wrote:
> > Message: Connection refused. Check that the hostname and port are correct
> > and that the postmaster is accepting TCP/IP connections.
>
> This is a tcpip error message, caused by the server not listening on the
> desired port. What have you set listen_addresses in postgresql.conf?
> Probably only localhost. Try adding the server's external address or * to
> listen on all available addresses.
>
> Kris Jurka
Also make sure that you run postmaster with the -i parameter, so postgres
server can accept TCPIP connections
Nelson Arape
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-09-29 00:59 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-28 22:11 Problem getting a connection with Postgres 8.0.3 Pedro Mendes <peter_mendes@clix.pt>
2005-09-28 22:25 ` Kris Jurka <books@ejurka.com>
2005-09-29 00:59 ` Nelson Arape <narape@ica.luz.ve>
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