Skip site navigation (1) Skip section navigation (2)

Re: Avoiding explicit addDataType calls for PostGIS

From: Kris Jurka <books(at)ejurka(dot)com>
To: PostGreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Cc: PostGIS Developer List <postgis-devel(at)postgis(dot)refractions(dot)net>,PostGis Users Mailinglist <postgis-users(at)postgis(dot)refractions(dot)net>,JTS Developer List <jts-devel(at)lists(dot)jump-project(dot)org>
Subject: Re: Avoiding explicit addDataType calls for PostGIS
Date: 2004-10-06 16:40:31
Message-ID: Pine.BSO.4.56.0410061127450.5501@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-jdbc

On Wed, 6 Oct 2004, Markus Schaber 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.

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.

> (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.

Kris Jurka

In response to

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-10-06 16:47:02
Subject: Re: RE : Postgres 8.0 + JDBC
Previous:From: Markus SchaberDate: 2004-10-06 16:16:53
Subject: Avoiding explicit addDataType calls for PostGIS

pgsql-general by date

Next:From: David FetterDate: 2004-10-06 16:43:56
Subject: Re: database constraints
Previous:From: Joshua D. DrakeDate: 2004-10-06 16:32:02
Subject: Re: database constraints

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group