I have not been able to connect to postgresql via postgresql jdbc. The problem is not with postgresql jdbc because tcpdump on the postgresql host shows that the connection is getting through.

The message I get from the java app is that the connection is refused. The username passed by DriverManager.getConnection works from psql on the postgresql host. I'm sure I know the password for this user and tried using a null string for the password too with the same result.

I'm running the java app on windows xp pro connecting to postgresql 8.3.5 on centos 4.7 via postgresql-8.3-604.jdbc4 on an private network. The hosts files are configured correctly. The postgresql.conf file has listen_addresses = '*'. Pg_hba.conf IPv4 local connections is:
host all all 192.168.1.0/24 MD5


TIA,
Bruce Hyatt

Search Discussions

  • Damian Carey at Dec 12, 2008 at 2:52 am

    On Fri, Dec 12, 2008 at 1:31 PM, Bruce Hyatt wrote:
    I have not been able to connect to postgresql via postgresql jdbc. The problem is not with postgresql jdbc because tcpdump on the postgresql host shows that the connection is getting through.

    The message I get from the java app is that the connection is refused. The username passed by DriverManager.getConnection works from psql on the postgresql host. I'm sure I know the password for this user and tried using a null string for the password too with the same result.

    I'm running the java app on windows xp pro connecting to postgresql 8.3.5 on centos 4.7 via postgresql-8.3-604.jdbc4 on an private network. The hosts files are configured correctly. The postgresql.conf file has listen_addresses = '*'. Pg_hba.conf IPv4 local connections is:
    host all all 192.168.1.0/24 MD5
    TIA,
    Bruce Hyatt
    Bruce, All I will guarantee that I am more of a Postgres novice than
    you, so try my response as you will :-))
    We Java desktop apps on using JDBC through to Postgres all on Windows.

    It sounds to me like a firewall issue. I suspect that the firewalls
    (I guess there is one on each machine) are letting the TCP get from
    the Client to the Server, but not allowing a response from Server
    back to Client. Another Microsoftism is that the Windows firewall may
    still be on (in series) with your installed firewall also on.

    Ensure you are monitoring the TCP (using SmartSniff or whatever) at
    BOTH ends. Your Server end may be OK.

    Just a guess.
    Cheers,
    -Damian
  • Bruce Hyatt at Dec 12, 2008 at 3:09 am

    --- On Thu, 12/11/08, Damian Carey wrote:

    wrote:
    I have not been able to connect to postgresql via
    postgresql jdbc. The problem is not with postgresql jdbc
    because tcpdump on the postgresql host shows that the
    connection is getting through.
    The message I get from the java app is that the
    connection is refused. The username passed by
    DriverManager.getConnection works from psql on the
    postgresql host. I'm sure I know the password for this
    user and tried using a null string for the password too with
    the same result.
    I'm running the java app on windows xp pro
    connecting to postgresql 8.3.5 on centos 4.7 via
    postgresql-8.3-604.jdbc4 on an private network. The hosts
    files are configured correctly. The postgresql.conf file has
    listen_addresses = '*'. Pg_hba.conf IPv4 local
    connections is:
    host all all 192.168.1.0/24 MD5
    TIA,
    Bruce Hyatt
    Bruce, All I will guarantee that I am more of a Postgres
    novice than
    you, so try my response as you will :-))
    We Java desktop apps on using JDBC through to Postgres all
    on Windows.

    It sounds to me like a firewall issue. I suspect that the
    firewalls
    (I guess there is one on each machine) are letting the TCP
    get from
    the Client to the Server, but not allowing a response from
    Server
    back to Client. Another Microsoftism is that the Windows
    firewall may
    still be on (in series) with your installed firewall also
    on.

    Ensure you are monitoring the TCP (using SmartSniff or
    whatever) at
    BOTH ends. Your Server end may be OK.
    Damian,

    I'm no expert at all but that's a good guess, something I hadn't thought of. I checked and first of all, it reminded me that the windows box is 2000 pro, not xp pro. More importantly, TCP/IP filtering is set to 'Permit All' for all ports and protocols. Beyond that, I am running an application server on the windows box with the httpd on the linux box and that is working fine.

    Thanks,
    Bruce

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedDec 12, '08 at 2:31a
activeDec 12, '08 at 3:09a
posts3
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Bruce Hyatt: 2 posts Damian Carey: 1 post

People

Translate

site design / logo © 2022 Grokbase