pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC drivers
2+ messages / 2 participants
[nested] [flat]

* JDBC drivers
@ 1998-07-10 19:52  Jeffrey Napolitano <jnapoli@setech.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jeffrey Napolitano @ 1998-07-10 19:52 UTC (permalink / raw)
  To: pgsql-interfaces

I have two programs:

one which I run via : java JavaProgram
	which connects to the Postgresql database, and puts stuff in, etc.
one which I run via a webserver - an applet, which is called in an html
	document, and attempts to access a Postgresql database.

Both programs load the driver via "Class.forName("postgresql.Driver")",
and use DriverManager.getConnection - however, the first one, the
application, apparently finds the postgresql.Driver via its CLASSPATH.
The second one, the applet, does not HAVE a CLASSPATH because it is
invoked by the web server, and therefore returns "cannot find suitable
driver".

I have put postgresql.jar (the JDBC driver) in the directory that the
applet is being executed, but it is still not found.

There must be a way to use a JDBC driver with applets, right?
Unfortunately, I don't know how to which is environment variable
"independent"...anyone?

------------------ 
Jeffrey Napolitano
Lowly Intern
Software Emancipation Technology



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] JDBC drivers
@ 1998-07-12 16:40  Peter T Mount <peter@retep.org.uk>
  parent: Jeffrey Napolitano <jnapoli@setech.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter T Mount @ 1998-07-12 16:40 UTC (permalink / raw)
  To: Jeffrey Napolitano <jnapoli@setech.com>; +Cc: pgsql-interfaces

On Fri, 10 Jul 1998, Jeffrey Napolitano wrote:

> I have put postgresql.jar (the JDBC driver) in the directory that the
> applet is being executed, but it is still not found.

The jar file must be defined in the <applet> tag. Now most browsers don't
support multiple archives, so there are two way around this:

1) unpack postgresql.jar, so that the postgres directory is in the same
   directory as your applet.

2) unpack as in (1), but then repack the driver and your applet into a new
   .jar file, and refer that in the <applet> tag.

> There must be a way to use a JDBC driver with applets, right?
> Unfortunately, I don't know how to which is environment variable
> "independent"...anyone?

Applets don't have access to environment variables.

-- 
Peter T Mount peter@retep.org.uk or petermount@earthling.net
Main Homepage: http://www.retep.org.uk
************ Someday I may rebuild this signature completely ;-) ************
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-07-12 16:40 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-07-10 19:52 JDBC drivers Jeffrey Napolitano <jnapoli@setech.com>
1998-07-12 16:40 ` Peter T Mount <peter@retep.org.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