X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.192]) by svr1.postgresql.org (Postfix) with ESMTP id D03D3D1C922 for ; Mon, 21 Jul 2003 02:35:59 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr4.postgresql.org [64.117.224.192]) (amavisd-new, port 10024) with ESMTP id 86776-07 for ; Mon, 21 Jul 2003 02:35:54 +0000 (GMT) Received: from exchange.hq.openratings.com (unknown [141.149.165.226]) by svr1.postgresql.org (Postfix) with ESMTP id 3107BD1C85A for ; Sun, 20 Jul 2003 23:35:54 -0300 (ADT) Received: from openratings.com (dsl092-073-052.bos1.dsl.speakeasy.net [66.92.73.52]) by exchange.hq.openratings.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 38QMVR7B; Sun, 20 Jul 2003 22:35:57 -0400 Message-ID: <3F1B51C5.4080108@openratings.com> Date: Sun, 20 Jul 2003 22:36:53 -0400 From: Dima Tkach User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett Cc: Kim Ho , Fernando Nasser , Barry Lind , pgsql-jdbc-list , Dave Cramer Subject: Re: Prepared Statements References: <3F18259C.6090503@redhat.com> <1058548037.19658.159.camel@topanga.toronto.redhat.com> <3F183004.4010508@openratings.com> <3F1830F6.3020203@openratings.com> <1058550328.19657.168.camel@topanga.toronto.redhat.com> <3F183423.9030900@openratings.com> <1058551402.20165.177.camel@topanga.toronto.redhat.com> <3F183AE0.8060204@openratings.com> <20030719012555.GA20158@opencloud.com> <3F1AC5D1.4010307@openratings.com> <20030721000241.GB665@opencloud.com> In-Reply-To: <20030721000241.GB665@opencloud.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/189 X-Sequence-Number: 7573 Oliver Jowett wrote: >On Sun, Jul 20, 2003 at 12:39:45PM -0400, Dima Tkach wrote: > > >>The problem with this (and other similar suggestions in this thread - >>like use PGArray etc.) is that the app will not even compile with >>postgres jdbc classes. >>The whole point in using jdbc interfaces is to abstract the application >>from the particular driver implementation. >> >> > >My current approach is what Fernando suggested -- use setArray() and look >for a preceeding IN. This can work without needing any postgres specific >classes -- I'll add a simple implementation of java.sql.Array that wraps a >Java array to the driver source, but if you don't want to be dependent on >the driver you can provide your own implementation. > > I don't want to provide my own iplementation either :-) I was fairly happy with what it used to be - just call setObject () and be done with it Anything else does look like an overkill... >The interface-abstraction argument only really works up to the point where >you want to do something not defined in the interface. Usually when I'm >doing DB-specific extension stuff I have a per-DB subclass that does the >special bits; if you don't have the driver available, you don't compile that >subclass. So I don't really buy the "can't build" argument. The same >thing applies to extensions like setUseServerPrepare(), BTW. > Yep. That's exactly why I was arguing against having it to beging with back in the beginning of 7.3 .. I lost that one too :-( ... but still believe it was the wrong idea. I mean, as I said before, I do have do go an extra mile because of this precompiled query plan stuff... I am writing functions in C that cache query plans and return strings, and call them from java, and pase strings back in rows... I just can't afford casting my statements to org.jdbc.postgres.Something... sorry - I can't write my apps assuming that postgres is the only db they'll ever need :-( Dima