From peter_mendes@clix.pt Wed Sep 28 22:11:13 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9639ED9B0C for ; Wed, 28 Sep 2005 19:11:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62247-09 for ; Wed, 28 Sep 2005 22:11:09 +0000 (GMT) Received: from mailrly03.isp.novis.pt (mailrly03.isp.novis.pt [195.23.133.213]) by svr1.postgresql.org (Postfix) with ESMTP id ADEC4D9AAA for ; Wed, 28 Sep 2005 19:11:08 -0300 (ADT) Received: (qmail 23098 invoked from network); 28 Sep 2005 22:11:09 -0000 Received: from unknown (HELO mailfrt11.isp.novis.pt) ([195.23.133.227]) (envelope-sender ) by mailrly03.isp.novis.pt with compressed SMTP; 28 Sep 2005 22:11:09 -0000 Received: (qmail 17495 invoked from network); 28 Sep 2005 22:11:09 -0000 Received: from unknown (HELO tower) (Sent_by_authenticated_user_x2486193@[87.196.13.17]) (envelope-sender ) by mailfrt11.isp.novis.pt with SMTP; 28 Sep 2005 22:11:09 -0000 From: "Pedro Mendes" To: Subject: Problem getting a connection with Postgres 8.0.3 Date: Wed, 28 Sep 2005 23:11:11 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0000_01C5C481.EB122F70" X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcXEeYjDFgsijRfsR5eQJUTfOrLNAQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-Id: <20050928221108.ADEC4D9AAA@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.755 required=5 tests=[FORGED_RCVD_HELO=0.05, HTML_MESSAGE=0.001, MSGID_FROM_MTA_ID=1.704] X-Spam-Level: * X-Archive-Number: 200509/121 X-Sequence-Number: 13906 This is a multi-part message in MIME format. ------=_NextPart_000_0000_01C5C481.EB122F70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0000_01C5C481.EB122F70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

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:

 

         =             &= nbsp; 

         =             &= nbsp;  try=

         =             &= nbsp;  {

         =             &= nbsp;           &n= bsp;  Class.forName("org.post= gresql.Driver");

         =             &= nbsp;           &n= bsp;  Connection db =3D = DriverManager.getConnection("jdbc:postgresql://192.168.8.2/cgm"= ,"cgm","esperanca");

 

for( SQLWarning warn =3D db.getWarnings(); warn !=3D = null; warn =3D warn.getNextWarning() )

         =             &= nbsp;           &n= bsp;  {

         =             &= nbsp;           &n= bsp;           &nb= sp;  System.out.println( "SQL Warning:" ) ;

         =             &= nbsp;           &n= bsp;           &nb= sp;  System.out.println( "State  : " + warn.getSQLState()  ) = ;

         =             &= nbsp;           &n= bsp;           &nb= sp;  System.out.println( "Message: " + warn.getMessage()   ) = ;

         =             &= nbsp;           &n= bsp;           &nb= sp;  System.out.println( "Error  : " + warn.getErrorCode() ) = ;

         =             &= nbsp;           &n= bsp;  }

….

 

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

 

 

------=_NextPart_000_0000_01C5C481.EB122F70-- From books@ejurka.com Wed Sep 28 22:25:14 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3ABB2D9B15 for ; Wed, 28 Sep 2005 19:25:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67826-09 for ; Wed, 28 Sep 2005 22:25:10 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id CB536D9B08 for ; Wed, 28 Sep 2005 19:25:10 -0300 (ADT) Received: (qmail 7325 invoked by uid 1112); 28 Sep 2005 22:25:38 -0000 Date: Wed, 28 Sep 2005 17:25:38 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Pedro Mendes Cc: pgsql-jdbc@postgresql.org Subject: Re: Problem getting a connection with Postgres 8.0.3 In-Reply-To: <20050928221108.ADEC4D9AAA@svr1.postgresql.org> Message-ID: References: <20050928221108.ADEC4D9AAA@svr1.postgresql.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.008 required=5 tests=[AWL=0.008] X-Spam-Level: X-Archive-Number: 200509/122 X-Sequence-Number: 13907 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 From narape@ica.luz.ve Thu Sep 29 01:27:58 2005 X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 471ACD928F for ; Wed, 28 Sep 2005 22:27:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11499-10 for ; Thu, 29 Sep 2005 01:27:52 +0000 (GMT) Received: from cuaima.ica.luz.ve (cuaima.ica.luz.edu.ve [150.185.222.161]) by svr1.postgresql.org (Postfix) with ESMTP id 32AA1D90EC for ; Wed, 28 Sep 2005 22:27:46 -0300 (ADT) Received: from tragavenado.luz.edu.ve (tragavenado.ica.luz.ve [10.2.208.202]) by cuaima.ica.luz.ve (Postfix) with ESMTP id D9D5391608 for ; Wed, 28 Sep 2005 21:01:52 -0400 (VET) From: Nelson Arape To: pgsql-jdbc@postgresql.org Subject: Re: Problem getting a connection with Postgres 8.0.3 Date: Wed, 28 Sep 2005 20:59:42 -0400 User-Agent: KMail/1.8.2 References: <20050928221108.ADEC4D9AAA@svr1.postgresql.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200509282059.43002.narape@ica.luz.ve> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.038 required=5 tests=[AWL=-0.013, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/123 X-Sequence-Number: 13908 El Mi=E9 28 Sep 2005 18:25, Kris Jurka escribi=F3: > On Wed, 28 Sep 2005, Pedro Mendes wrote: > > Message: Connection refused. Check that the hostname and port are corre= ct > > 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=20 server can accept TCPIP connections Nelson Arape > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org