Re: jdbc pg_hba.conf error

From: "Bhavana(dot)Rakesh" <Bhavana(dot)Rakesh(at)noaa(dot)gov>
To: Devrim GÜNDÜZ <devrim(at)CommandPrompt(dot)com>
Cc: pgsql_general <pgsql-general(at)postgresql(dot)org>
Subject: Re: jdbc pg_hba.conf error
Date: 2007-05-30 15:47:48
Message-ID: 465D9CA4.8060203@noaa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
I'm still getting the error

[brakesh(at)lnx383 ~/db_connect]$ java db_connect_pgsql.class
Checking if Driver is registered with DriverManager

Registered the driver ok, making DB connection now

Couldn't connect: print out a stack trace and exit.
org.postgresql.util.PSQLException: A connection error has occurred:
org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
"127.0.0.1", user "brakesh", database "testing123", SSL off

at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnectionV3(AbstractJdbc1Connection.java:337)
at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:214)
at org.postgresql.Driver.connect(Driver.java:139)
at java.sql.DriverManager.getConnection(DriverManager.java:559)
at java.sql.DriverManager.getConnection(DriverManager.java:189)
at db_connect_pgsql.main(db_connect_pgsql.java:25)

Here is my updated version of pg_hba.conf file
__________________________________________________________________________
#
# If you want to allow non-local connections, you need to add more
# "host" records. Also, remember TCP/IP connections are only enabled
# if you enable "tcpip_socket" in postgresql.conf.

# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host all all trust

# IPv4-style local connections:
host all all 127.0.0.1 255.255.255.255 trust
host testing123 brakesh 127.0.0.1 255.255.255.255 trust
# IPv6-style local connections:
#host all all ::1/128
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust

# Using sockets credentials for improved security. Not available everywhere,
# but works on Linux, *BSD (and probably some others)

#local all all ident sameuser

#Allow any user from any host with IP address 192.168.93.x to
# connect to database "template1" as the same username that ident on that
# host identifies him as (typically his Unix username):
#
#TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
host testing123 all 140.90.193.238 255.255.255.0 ident sameuser

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2007-05-30 15:48:54 Re: On-line / off-line trace of SQL statements presented to the Postgres SQL engine
Previous Message Aurynn Shaw 2007-05-30 15:43:37 Re: On-line / off-line trace of SQL statements presented to the Postgres SQL engine