Skip site navigation (1) Skip section navigation (2)

Problem getting a connection with Postgres 8.0.3

From: "Pedro Mendes" <peter_mendes(at)clix(dot)pt>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Problem getting a connection with Postgres 8.0.3
Date: 2005-09-28 22:11:11
Message-ID: 20050928221108.ADEC4D9AAA@svr1.postgresql.org (view raw or flat)
Thread:
Lists: 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

 

 

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2005-09-28 22:25:38
Subject: Re: Problem getting a connection with Postgres 8.0.3
Previous:From: Alfredo RicoDate: 2005-09-28 20:27:19
Subject: How to retieve binary data (bytea) without problem ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group