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

JDBC connection refused

From: John Collins <jcollins(at)cs(dot)umn(dot)edu>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: JDBC connection refused
Date: 2000-03-01 04:12:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
I have Postgresql set up, and I can access it with jdbc or pgaccess
locally, and with pgaccess from another linux box on the same local
net.  However, I can't get a connection with jdbc across the net.  The
relevant code is

  public static void main (String[] args) {
    try {
      Connection con =
          "collins", "");
      // Do something useful here
      Statement stmt = con.createStatement();

and the error message is

Connection refused. Check that the hostname and port is correct, and
that the postmaster is running with the -i flag, which enables TCP/IP
 at postgresql.Connection.openConnection(, Compiled Code)

 at postgresql.Driver.connect(, Compiled Code)
 at java.sql.DriverManager.getConnection(, Compiled

Here's what I've checked:
 - postmaster is indeed being run with the -i flag.  I think neither the
local jdbc or the remote pgaccess would work otherwise.
 - I've used every name I can think of, including the ip address, in the
URL above.  I've used the port and I've not used the port.
 - I've used netstat to check that postmaster is indeed listening on

I'm stumped.  Thanks in advance for any assistance.

John Collins
University of Minnesota

pgsql-interfaces by date

Next:From: Byron NikolaidisDate: 2000-03-01 04:44:33
Subject: Re: [INTERFACES] Serious problem with the odbc driver and VFP
Previous:From: Willy De la CourtDate: 2000-02-29 20:58:39
Subject: Serious problem with the odbc driver and VFP

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