Re: [INTERFACES] Loading JDBC - driver

From: Peter T Mount <peter(at)taer(dot)maidstone(dot)gov(dot)uk>
To: Sergei Chernev <ser(at)nsu(dot)ru>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Loading JDBC - driver
Date: 1999-02-15 09:01:09
Message-ID: Pine.LNX.4.04.9902150858340.19908-100000@taer.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)it(dot)maidstone(dot)gov(dot)uk
Anything I write here are my own views, and cannot be taken as being the
official words of Maidstone Borough Council

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Claudio Cicognani 1999-02-15 09:20:28 How to start with odbc
Previous Message Sergei Chernev 1999-02-15 08:45:13 Loading JDBC - driver