Re: JDBC conncetion fails, please, advise

From: Robin Iddon <robin(at)edesix(dot)com>
To: Leena Puijola <leena(dot)puijola(at)endero(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: JDBC conncetion fails, please, advise
Date: 2006-03-25 08:07:48
Message-ID: 4424FA54.2040404@edesix.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Is your client machine on the same machine as the database?

Your pg_hba.conf file needs to have an entry in it that covers your
client machine. It's not 100% clear from your post whether you've
achieved that or not (I think you've added your server to the
pg_hba.conf, not your client).

So if my server is on 192.168.2.1 and my client is 10.10.10.1 then the
pg_hba.conf file needs:

# TYPE DATABASE USER CIDR-ADDRESS METHOD

# IPv4 non-local connections:
host all all 10.10.10.1/32 trust

And the jdbc connect string will be something like
jdbc:postgresql://192.168.2.1/my_database

Can you post your pg_hba.conf file?

Cheers,
Robin

Leena Puijola wrote:

>Hi,
>
>Please can you assist.
>
>I am trying to connect to PostgreSQL via JDBC.
>
>Database version is 8.0.1 and java software version 1.4.2.
>
>
>I have configured the pg_hba.conf file as follows
>
>host all all ip_address/32 trust
>
>
>ip_address is the ip_address of the host holding the database.
>
>
>my connection string to postgres is as
>'jdbc:postgresql://my_host:5432/my_database'
>
>
>I'm getting the error message:
>
>Connection error has occurred: org.postgresql.util.PSQLException: FATAL: missing or erroneous pg_hba.conf file
>
>
>
>what is the problem? Please, advise.
>
>Regards,
>Leena
>
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Jim C. Nasby 2006-03-25 13:13:51 Re: use of <END> in psql
Previous Message Thomas F. O'Connell 2006-03-25 06:23:22 Re: Continuous On-line Backups