Re: [INTERFACES] Loading JDBC - driver - Mailing list pgsql-interfaces

From Peter T Mount
Subject Re: [INTERFACES] Loading JDBC - driver
Date
Msg-id Pine.LNX.4.04.9902150858340.19908-100000@taer.maidstone.gov.uk
Whole thread Raw
In response to Loading JDBC - driver  ("Sergei Chernev" <ser@nsu.ru>)
List pgsql-interfaces
On Mon, 15 Feb 1999, Sergei Chernev wrote:

> Hello,
>
> I wonder, if there is a way to load JDBC- driver from network.
> I know the method to connect using  jdbc6.4.jar on local disk
> and editing CLASSPATH, but it seems to me inconvenient to
> ask user to download driver and edit environment.
>
> Does it possible to use construction like that:
> Class.forName("http://somewhere.com/postgresql.Driver/jdbc6.4.jar/postgresql
> .Driver").newInstance(); ?
> Excuse me if it is FAQ, but I didn't find anything of the kind in mailing
> list.

That's ok. What you need is a custom class loader, that fetches the jar
file from a url, then extracts the classes from it.

This is how browsers do it, but as to how you would write a class loader
is another question (one of those things I havent got round to trying yet)
;-)

Peter

--
Peter Mount, IT Section
petermount@it.maidstone.gov.uk
Anything I write here are my own views, and cannot be taken as being the
official words of Maidstone Borough Council



pgsql-interfaces by date:

Previous
From: "Sergei Chernev"
Date:
Subject: Loading JDBC - driver
Next
From: Claudio Cicognani
Date:
Subject: How to start with odbc