pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedCan't connect to Postgres with JDBC
2+ messages / 2 participants
[nested] [flat]
* Can't connect to Postgres with JDBC
@ 1998-01-19 18:15 Brian Cross <bscross@us.ibm.com>
0 siblings, 1 reply; 2+ messages in thread
From: Brian Cross @ 1998-01-19 18:15 UTC (permalink / raw)
To: pgsql-interfaces
Hi,
I'm trying to connect to my postgres database(that came with RedHat
5.0) with an applet using JDBC. The driver seems to be loading fine, but I
receive this error when starting the applet:
java.sql.SQLException: Failed to authenticate client as Postgres user 'bscross'
using the default authentication type: be_recvauth: host-based authentication
failed.
The bscross user is both a system user and one I created in postgres.
Do I need to change the authentication type, and if so what does it need to be?
I have read every FAQ and HOWTO I could find with no luck. I would be forever
in debt if someone could help me out with this. Thanks!
--Brian Cross.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [INTERFACES] Can't connect to Postgres with JDBC
@ 1998-01-20 22:26 Peter T Mount <pgint@maidast.demon.co.uk>
parent: Brian Cross <bscross@us.ibm.com>
0 siblings, 0 replies; 2+ messages in thread
From: Peter T Mount @ 1998-01-20 22:26 UTC (permalink / raw)
To: Brian Cross <bscross@us.ibm.com>; +Cc: pgsql-interfaces
On Mon, 19 Jan 1998, Brian Cross wrote:
> Hi,
>
> I'm trying to connect to my postgres database(that came with
> RedHat 5.0) with an applet using JDBC. The driver seems to be loading
> fine, but I receive this error when starting the applet:
>
> java.sql.SQLException: Failed to authenticate client as Postgres user
> 'bscross' using the default authentication type: be_recvauth: host-based
> authentication failed.
>
> The bscross user is both a system user and one I created in postgres.
> Do I need to change the authentication type, and if so what does it
> need to be?
>
> I have read every FAQ and HOWTO I could find with no luck. I would be
> forever in debt if someone could help me out with this. Thanks!
Ok, there are three things that can stop an applet from connecting, and
you have hit the one which affects all clients, not just jdbc.
The file $PGDATA/pg_hba.conf contains a list of hosts that are allowed
access to any database. What is happening is that your web browser is
attempting to access the database from an ip address/mask not defined in
that file. Full instructions are included inside the file.
The other two are where the applet is downloaded from one host, and the
database is on another. This is not possible, and throws a
SecurityException.
The third one is where the browser doesn't support JDK 1.1
Anyhow, when it says about "Host based authentication", the first place to
look in is pg_hba.conf
PS: Another test is (if you are running the applet from the same machine
as the database), to try the url with both your hostname, and localhost.
I'd bet you are using your host name, and it works with localhost. If so,
then pg_hba.conf is where your problem is.
--
Peter T Mount petermount@earthling.net or pmount@maidast.demon.co.uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-01-20 22:26 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-01-19 18:15 Can't connect to Postgres with JDBC Brian Cross <bscross@us.ibm.com>
1998-01-20 22:26 ` Peter T Mount <pgint@maidast.demon.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox