Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 3D8B59FA473 for ; Fri, 2 Feb 2007 06:37:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 47197-07 for ; Fri, 2 Feb 2007 06:36:50 -0400 (AST) X-Greylist: delayed 00:06:39.920011 by SQLgrey-1.7.4 Received: from maillink.ch (maillink.ch [212.55.197.230]) by postgresql.org (Postfix) with ESMTP id 5B05B9FA42F for ; Fri, 2 Feb 2007 06:36:50 -0400 (AST) Received: (qmail 28331 invoked by uid 600); 2 Feb 2007 10:30:08 -0000 Received: by simscan 1.1.0 ppid: 28325, pid: 28328, t: 0.0418s scanners: regex: 1.1.0 clamav: 0.90rc3/m:42 Received: from 84-75-243-30.dclient.hispeed.ch (HELO ?192.168.1.6?) (david@gsoa.ch@84.75.243.30) by 0 with SMTP; 2 Feb 2007 10:30:07 -0000 Message-ID: <45C312B9.5000107@mediagonal.ch> Date: Fri, 02 Feb 2007 11:30:17 +0100 From: David Buchmann Organization: mediagonal.ch User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: jdbc connection problem References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/15 X-Sequence-Number: 16571 thanks a lot. Ubuntu 6.10 sets the port to 5433 instead of 5432. psql seems to consider this when not specifying a port - jdbc not. i changed the port setting in /etc/postgresql/8.1/main/postgresql.conf to 5432 and stopped postgres and started it new. now jdbc gets the connection. (restart / reload did not change the port.) Kris Jurka wrote: > > > Debian variants often have multiple servers installed on multiple ports. > Try adding explicit port numbers to both psql and jdbc connections to > ensure that you're getting the same thing. > > Kris Jurka > > On Thu, 1 Feb 2007, david@mediagonal.ch wrote: > >> i have a problem connecting to postgres using the jdbc driver. >> >> String url = "jdbc:postgresql://localhost/testdb"; >> String user = "username"; >> String pass = "password"; >> >> >> i get the exception org.postgresql.util.PSQLException: Connection >> Refused. Check that the hostname and port are correct and that the >> postmaster is accepting TCP/IP connections. >> >> however, using psql -h localhost -U username -W and then specifying >> the password works. so i do not see how this could be a general >> problem with postgresql listening on the wrong interface or not >> accepting connections from the local host. >> >> btw, i use psql 8.1.4 on ubuntu, jdbc is postgresql-8.1-408.jdbc2.jar >>