pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Schaber <schabios@logi-track.com>
To: PostGreSQL JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Avoiding explicit addDataType calls for PostGIS
Date: Thu, 7 Oct 2004 10:54:27 +0200
Message-ID: <20041007105427.2a559360@kingfisher.intern.logi-track.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0410061127450.5501@leary.csoft.net>
References: <20041006181653.4fc83924@kingfisher.intern.logi-track.com>
	<Pine.BSO.4.56.0410061127450.5501@leary.csoft.net>

Hi, Kris,

On Wed, 6 Oct 2004 11:40:31 -0500 (EST)
Kris Jurka <books@ejurka.com> wrote:

> > The second approach would add a "wrapper" parameter to the postgresql
> > driver url. This parameter contains comma-separated class names that all
> > implement a common interface. On every connect() call, the driver would
> > then instantiate all of those classes [1], and then pass
> > the created PGConnection to those classes, before return.
> 
> The problem with the driver instantiating any classes from strings is that 
> classloaders for the driver may not be able to load the given classes even 
> though user code could. 
>
> Note that PGConnection.addDataType(String type, 
> String classname) is deprecated for addDataType(String type, Class klass) 
> to avoid exactly this problem.

Is the opposite problem possible? I think of the driver class loader be
able to reach the driver extension, but not the user code class loader.

> That said I understand your frustration and I think your first approach is 
> rather clever.  Let's see what other people have to say about the other 
> approaches and the above limitation.

My driver wrapper approach even has the advantage that it can work with
different class loaders, as you can arbitrarily code whatever you want.

> > (BTW, is it possible that there is no license file in pg-jdbc cvs?)
> 
> Yeah, it used to be part of the main server tree and used that 
> license, but now that it's out on its own I'll see about adding one.  A 
> plain BSD license in case you were wondering.

I thought it to be like that. However, adding the license file to the
tree will simply remove all clues.

Thanks,
Markus Schaber

-- 
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com



view thread (21+ messages)  latest in thread

Message-ID: <20041007105427.2a559360@kingfisher.intern.logi-track.com>
Permalink:  ../20041007105427.2a559360@kingfisher.intern.logi-track.com/
Also on:    postgresql.org/message-id/20041007105427.2a559360@kingfisher.intern.logi-track.com

 · 

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-jdbc@postgresql.org
  Cc: schabios@logi-track.com
  Subject: Re: Avoiding explicit addDataType calls for PostGIS
  In-Reply-To: <20041007105427.2a559360@kingfisher.intern.logi-track.com>
  References: <20041006181653.4fc83924@kingfisher.intern.logi-track.com> <Pine.BSO.4.56.0410061127450.5501@leary.csoft.net> <20041007105427.2a559360@kingfisher.intern.logi-track.com>

* 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