pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Buchmann <david@mediagonal.ch>
To: pgsql-jdbc@postgresql.org
Subject: Re: jdbc connection problem
Date: Fri, 02 Feb 2007 11:30:17 +0100
Message-ID: <45C312B9.5000107@mediagonal.ch> (raw)
In-Reply-To: <Pine.BSO.4.64.0702011232170.7805@leary2.csoft.net>
References: <a3a08b525eff59fd0a1526e17f2194e5@localhost>
	<Pine.BSO.4.64.0702011232170.7805@leary2.csoft.net>

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





view thread (18+ messages)  latest in thread

Message-ID: <45C312B9.5000107@mediagonal.ch>
Permalink:  ../45C312B9.5000107@mediagonal.ch/
Also on:    postgresql.org/message-id/45C312B9.5000107@mediagonal.ch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: david@mediagonal.ch
  Subject: Re: jdbc connection problem
  In-Reply-To: <45C312B9.5000107@mediagonal.ch>
  References: <a3a08b525eff59fd0a1526e17f2194e5@localhost> <Pine.BSO.4.64.0702011232170.7805@leary2.csoft.net> <45C312B9.5000107@mediagonal.ch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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