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

Re: Problems connecting to postgres using JDBC Driver.

From: "Neil Peter Braggio" <pbraggio(at)gmail(dot)com>
To: Daniel Muñoz <daniel(dot)munoz(at)karinasoft(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Problems connecting to postgres using JDBC Driver.
Date: 2007-08-27 21:28:29
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Check the parameter  listen_addresses in the postgresql.conf file to set the
correct value for you (may be '*' to test).

Remove or comment the first host entry. I guess it is not a valid
CIDR-ADDRESS value ;-)

Restart your server and try again your java application.

Neil Peter Braggio

On 8/27/07, Daniel Muñoz <daniel(dot)munoz(at)karinasoft(dot)com> wrote:
> Hello.  I need your help.
> I have a box running Fedora Core 6. I installed the Postgres Server using
> yum, so i have the distributing software.
> Ever since i installed it im having problems connecting my java
> applications to the database.
> But first thing first:
> This is the error message i get when connecting to the database:
> Checking if Driver is registered with DriverManager.
> Registered the driver ok, so let's make a connection.
> Couldn't connect: print out a stack trace and exit.
> org.postgresql.util.PSQLException: FATAL: missing or erroneous pg_hba.conf
> file
>         at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(
> :275)
>         at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl
> (
>         at org.postgresql.core.ConnectionFactory.openConnection(
>         at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(
>         at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(
>         at org.postgresql.jdbc3.Jdbc3Connection .<init>(
>         at org.postgresql.Driver.makeConnection(
>         at org.postgresql.Driver.connect(
>         at java.sql.DriverManager.getConnection( :525)
>         at java.sql.DriverManager.getConnection(
>         at Connect.main(
> the pg_hba.conf file is located in:  /var/lib/pgsql/data    and it looks
> like this:
> # "local" is for Unix domain socket connections only
> #local   all         all                               ident sameuser
> local   all     all             md5
> # IPv4 local connections:
> #host    all         all          ident sameuser
> host    all     all     ubuntu  md5
> host    all     all    md5
> # IPv6 local connections:
> #host    all         all         ::1/128               ident sameuser
> host    all     all     ::1/128 md5
> somewhere I read that i should live a blank line at the very bottom of the
> file, so i have...  Also, i have checked that each value is separated by a
> tab.  Also, i read that the PATH and the LD_LIBRARY_PATH should include the
> path to the postgres configuration.  So on /etc/bashrc i have the following:
> export LD_LIBRARY_PATH=$JMFHOME/lib:/var/lib/pgsql/data/:$LD_LIBRARY_PATH
> export PATH=/var/lib/pgsql/data/:$PATH
> Now, this is the weird thing...  I can connect using the psql client.
> psql -t template1 -U damunoz
> and then entering the password....
> So I have no idea what is going on...  I tested with different drivers
> with the same results.  My guess is that maybe this has something to do with
> the Fedora's distribution.  I will post this same message to them as well.
> Thanks in advance for your help!
> daniel
> --
> ========================
> Daniel Muñoz Honiball
> daniel(dot)munoz(at)karinasoft(dot)com
> Software para la Gloria de Dios.
> Si se humillare mi pueblo, sobre los cuales ni nombre es invocado, y
> oraren,
> y buscaren mi rostro, y se convirtieren de sus malos caminos;
> entonces yo oiré desde los cielos, y perdonaré sus pecados, y sanaré su
> tierra.
> 2 Crónicas 7-14

In response to


pgsql-admin by date

Next:From: Scott MarloweDate: 2007-08-27 21:40:25
Subject: Re: Copy cmd error
Previous:From: Daniel MuñozDate: 2007-08-27 20:42:05
Subject: Problems connecting to postgres using JDBC Driver.

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