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--