pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kenny Freeman <freeman@cs.dal.ca>
To: Kapoor, Nishikant X <Nishikant.X.Kapoor@nspco.com>
Cc: 'pgsql-interfaces@postgreSQL.org' <pgsql-interfaces@postgreSQL.org>
Cc: 'pgsql-general@postgreSQL.org' <pgsql-general@postgreSQL.org>
Cc: 'java-linux@java.blackdown.org' <java-linux@java.blackdown.org>
Cc: 'java-linux-help@java.blackdown.org' <java-linux-help@java.blackdown.org>
Subject: Re: No DB connection in Netscape ? Please help.
Date: Fri, 14 Aug 1998 14:11:01 -0300 (ADT)
Message-ID: <Pine.GSO.3.96.980814140901.16189C-100000@borg> (raw)
In-Reply-To: <C7DCBA49A357D11196A500805F851ACD0146165C@MNMAIL04>

I could be on thin ice, but applets can only make connections to the site
that they were loaded from. I noticed a security... something or other in
the java console o/p (just a quick look). Maybe that explains why you can
connect on one machine, and not the other....

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.
> 
> The two machines genx and mm01 are on the same network and can ping each
> other
> using the hostnames.
> 
> THE CLASSPATH IS *NOT* SET ON RISC MACHINE (mm01) and the postgresql.jar
> is already
> in mm01:$MOZILLA_HOME/java/classes. The JDBC interface is as follows:
> 
>     // Load the driver
>     try {
>       Class.forName(PrfConstants.DB_DRVR);
>     } catch(Exception e) {
>         System.out.println("openDb(PrfDb): Class.forName() failed. e= "
> + e.getMessage());
>         return (false);
>       }
> 
>     // Connect to database
>     System.out.println("openDb(PrfDb):Connecting to Database. URL =
> jdbc:postgresql:prfdb...");
>     try {
>       connect = DriverManager.getConnection("jdbc:postgresql:prfdb",
> "postgres", "");
>     } catch (SQLException e) {
>         System.out.println("openDb(PrfDb): Could not connect to
> database. e=" + e.getMessage() );
>         connect = null;
>         return (false);
>       } catch (Exception e) {
>           System.out.println("openDb(PrfDb): Could not connect. e= " +
> e.getMessage());
>           connect = null;
>           return (false);
>         }
> 
> 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 !!!
> 
> Thanks much in advance.
> Nishi
> 
> --------To err is human but to really mess it up is computer--------
> mailto:nishikant.x.kapoor@nspco.com   http://www.c3ipros.com/nkapoor
> -----------------------------------~~~------------------------------
> 




view thread (5+ messages)  latest in thread

Message-ID: <Pine.GSO.3.96.980814140901.16189C-100000@borg>
Permalink:  ../Pine.GSO.3.96.980814140901.16189C-100000@borg/
Also on:    postgresql.org/message-id/Pine.GSO.3.96.980814140901.16189C-100000@borg

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-interfaces@postgresql.org
  Cc: freeman@cs.dal.ca, Nishikant.X.Kapoor@nspco.com, pgsql-general@postgreSQL.org, java-linux@java.blackdown.org, java-linux-help@java.blackdown.org
  Subject: Re: No DB connection in Netscape ? Please help.
  In-Reply-To: <Pine.GSO.3.96.980814140901.16189C-100000@borg>
  References: <C7DCBA49A357D11196A500805F851ACD0146165C@MNMAIL04> <Pine.GSO.3.96.980814140901.16189C-100000@borg>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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