From: david@mediagonal.ch
To: pgsql-jdbc@postgresql.org
Subject: jdbc connection problem
Date: Thu, 1 Feb 2007 15:46:44 +0100
Message-ID: <a3a08b525eff59fd0a1526e17f2194e5@localhost> (raw)
hi everybody,
i have a problem connecting to postgres using the jdbc driver.
took the org.postgresql.test.jdbc2.DriverTest and modified it to use
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
any ideas?
thanks,
david
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: <a3a08b525eff59fd0a1526e17f2194e5@localhost>
References: <a3a08b525eff59fd0a1526e17f2194e5@localhost>
* 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