Re: [INTERFACES] No DB connection in Netscape ? Please help.

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: "Kapoor, Nishikant X" <Nishikant(dot)X(dot)Kapoor(at)nspco(dot)com>
Cc: "'pgsql-interfaces(at)postgreSQL(dot)org'" <pgsql-interfaces(at)postgresql(dot)org>, "'pgsql-general(at)postgreSQL(dot)org'" <pgsql-general(at)postgresql(dot)org>, "'java-linux(at)java(dot)blackdown(dot)org'" <java-linux(at)java(dot)blackdown(dot)org>, "'java-linux-help(at)java(dot)blackdown(dot)org'" <java-linux-help(at)java(dot)blackdown(dot)org>
Subject: Re: [INTERFACES] No DB connection in Netscape ? Please help.
Date: 1998-08-15 10:47:46
Message-ID: Pine.LNX.3.96.980815114146.493j-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

On Fri, 14 Aug 1998, Kapoor, Nishikant X wrote:

> Hello friends
>
> I have apache-1.1.3-3 and PostgreSQL-6.3.2 running on my Linux RH4.2,
> kernel 2.0.30 (genx). I have a Java Applet that tries to connect to
> PostgreSQL
> using JDBC, from NS-4.5b1 on an IBM RISC6000, AIX-4.1.4 (mm01).
>
> Typing "mm01: netscape http://genx/PrfApplet.htm" brings up the applet
> in the NS
> but the database connection is not established. The Java console shows:
>
> openDb(PrfDb):Connecting to Database URL = jdbc:postgresql:prfdb...
> openDb(PrfDb): Could not connect. e= security.Couldn't connect to
> 'localhost' with origin from 'genx'.
>
> The same problems exits when I start NS from the same machine where the
> PostgreSQL
> server is running i.e. the Linux box(genx).
>
> *** But, when I use "genx: netscape http://127.0.0.1/PrfApplet.htm" on
> genx, the
> *** database connection gets established.

Have you configured pg_hba.conf to allow connections from mm01 to the
database?

By default, it allows connections from localhost (127.0.0.1) but for other
remote hosts, you have to add their (or a subnet's) IP address/mask before
PostgreSQL will allow a connection.

> The two machines genx and mm01 are on the same network and can ping each
> other
> using the hostnames.

This is the same reason why genx fails - the host name is using the
ethernet port, and not localhost.

>
> THE CLASSPATH IS *NOT* SET ON RISC MACHINE (mm01) and the postgresql.jar
> is already
> in mm01:$MOZILLA_HOME/java/classes.

The fact that you are getting connections failing or succeeding rules this
out. If it was a classpath problem, you'd be getting different exceptions
being thrown.

AFAIK, browsers don't use CLASSPATH anyhow.

> Can someone please help me. This has been much more complicated than
> what I'd anticipated.
>
> I'm not sure if this is a problem at Java end or the PostgreSQL end. So,
> please
> excuse me if I've posted this problem to the wrong group. I'm just
> desperate for help !!!

It looks like postgres is not allowing the connection, so the first place
to check is pg_hba.conf

--
Peter T Mount peter(at)retep(dot)org(dot)uk or petermount(at)earthling(dot)net
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vadim Mikheev 1998-08-15 15:13:14 Re: [GENERAL] getting the currval of a sequence
Previous Message Kapoor, Nishikant X 1998-08-14 20:17:18 RE: [GENERAL] No DB connection in Netscape ? Please help.

Browse pgsql-interfaces by date

  From Date Subject
Next Message Goran Thyni 1998-08-15 13:14:50 PgSQL released
Previous Message secret 1998-08-15 02:43:36 C API - Authentication Question