X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CE98B32B0BC for ; Thu, 7 Oct 2004 09:56:32 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 93785-06 for ; Thu, 7 Oct 2004 08:55:59 +0000 (GMT) Received: from mail.logi-track.com (burro.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 565AA32AAA3 for ; Thu, 7 Oct 2004 09:54:40 +0100 (BST) Received: from kingfisher.intern.logi-track.com (G7ed7.g.pppool.de [80.185.126.215]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id BACA630334; Thu, 7 Oct 2004 10:54:32 +0200 (CEST) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id AE7E3AB2E1; Thu, 7 Oct 2004 10:54:27 +0200 (CEST) Date: Thu, 7 Oct 2004 10:54:27 +0200 From: Markus Schaber To: PostGreSQL JDBC Subject: Re: Avoiding explicit addDataType calls for PostGIS Message-ID: <20041007105427.2a559360@kingfisher.intern.logi-track.com> In-Reply-To: References: <20041006181653.4fc83924@kingfisher.intern.logi-track.com> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K 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. >=20 > The problem with the driver instantiating any classes from strings is tha= t=20 > classloaders for the driver may not be able to load the given classes eve= n=20 > though user code could.=20 > > Note that PGConnection.addDataType(String type,=20 > String classname) is deprecated for addDataType(String type, Class klass)= =20 > 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 i= s=20 > rather clever. Let's see what other people have to say about the other= =20 > 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?) >=20 > Yeah, it used to be part of the main server tree and used that=20 > license, but now that it's out on its own I'll see about adding one. A= =20 > 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 --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com