X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id C4EF7D1C4E3 for ; Mon, 21 Jul 2003 14:56:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 28990-01 for ; Mon, 21 Jul 2003 14:56:14 +0000 (GMT) Received: from webmail.muc.domues.com (webmail.muc.domeus.com [62.67.54.176]) by svr1.postgresql.org (Postfix) with ESMTP id 5B10FD1C514 for ; Mon, 21 Jul 2003 11:56:13 -0300 (ADT) Received: from coppola.ecircle.de ([192.168.1.142]) by webmail.muc.domues.com (8.11.3/8.11.3/SuSE Linux 8.11.1-0.5) with ESMTP id h6LEtbk24112; Mon, 21 Jul 2003 16:55:37 +0200 Subject: Re: Prepared Statements From: Csaba Nagy To: Dmitry Tkach Cc: Oliver Jowett , pgsql-jdbc-list In-Reply-To: <3F1BF78F.4040604@openratings.com> References: <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> <3F1B51C5.4080108@openratings.com> <20030721030157.GE665@opencloud.com> <3F1BF78F.4040604@openratings.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-11) Date: 21 Jul 2003 16:55:37 +0200 Message-Id: <1058799337.25132.327.camel@coppola.ecircle.de> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/207 X-Sequence-Number: 7591 See my comments below. On Mon, 2003-07-21 at 16:24, Dmitry Tkach wrote: > > > > > >Um, so you don't want to depend on the JDBC postgresql driver at all, but > >don't mind having postgresql-specific behaviour elsewhere so long > >as you can do it purely through the JDBC interface? That seems a bit > >inconsistent. > > > > > I don't see anything "inconsistent" about it. But please... did you ever use a different database than Postgres ? The way you're passing the parameters is VERY much postgres specific, furthermore, it relies on some non-standard behavior... > I am just choosing the lesser of two evils. > At least, I don't need to know what database I am going to be working > with when I compile the code. ... which problem you wouldn't have if you would use standard JDBC code. I agree that standards suck sometime, but then if you want to use a DB specific feature, I can't see why not make it a compile time necessity - it might be a further benefit to remind you that your code will not work with other databases. > > >Note that using setObject() to set IN clauses is no less postgresql-specific > >than using setArray() would be .. I know of at least one DB where you really > >can only set data values in a prepared statement as the prepared SQL is > >compiled down to a form of bytecode for DB-side execution, there *is* no > >textual substitution that goes on. > > > Right. I do need a scheme like what you suggest below to set up > database-specific logic. > The difference is - I do not need all the possible jdbc drivers to be > installed just to compile my application. > And I do not need to know which driver a particular customer is using to > send him my application. > And I don't need to force my customers to have to request a new app from > me if they decide to switch to another database. But yes you force your customers to use Postgres, or maybe to a set of databases which accept this hack - it is not standard. > > With your suggestion, the only way I can have the above is to pack all > the possible jdbc drivers into every build of the app... Yes, all the drivers which you are using special features from. That makes perfect sense - those are vendor specific dependencies in your code, the library will remind you about it all the time so you don't forget to tell the customers about it ;-) Cheers, Csaba.