Skip site navigation (1) Skip section navigation (2)

jdbc connection problem

From: <david(at)mediagonal(dot)ch>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: jdbc connection problem
Date: 2007-02-01 14:46:44
Message-ID: a3a08b525eff59fd0a1526e17f2194e5@localhost (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
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?



pgsql-jdbc by date

Next:From: Andreas Joseph KroghDate: 2007-02-01 15:32:43
Subject: Any reason for PSQLState not to be Serializable?
Previous:From: Jeffrey CoxDate: 2007-02-01 11:19:51
Subject: getArray and char[] - patches

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group