pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Dmitry Tkach <dmitry@openratings.com>
Cc: pgsql-jdbc-list <pgsql-jdbc@postgresql.org>
Subject: Re: Prepared Statements
Date: Tue, 22 Jul 2003 02:44:28 +1200
Message-ID: <20030721144428.GI2506@opencloud.com> (raw)
In-Reply-To: <3F1BF78F.4040604@openratings.com>
References: <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>

On Mon, Jul 21, 2003 at 10:24:15AM -0400, Dmitry Tkach wrote:

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

Pack the support code for all drivers in, yes. The drivers themselves you
don't need to provide, as the support classes don't get loaded unless the
particular driver it supports is present.

There's no reason you can't have a "generic" extension implementation that
works on a plain JDBC driver -- you just don't get the benefit of the
extensions. Default to that for drivers you don't recognize at runtime.

If your app doesn't work without a real implementation of the extensions,
then you're not going to be able to just plug in a new JDBC driver and have
it work *regardless of how you get at those extensions* -- you have an
application that requires more JDBC provides, end of story. If you're in
this situation but want to allow your customers to run on arbitary DBs
without your intervention -- document your Extensions interface and release
it to your customers; they can build their own implementation for whatever
DB they like.

-O



view thread (105+ messages)  latest in thread

Message-ID: <20030721144428.GI2506@opencloud.com>
Permalink:  ../20030721144428.GI2506@opencloud.com/
Also on:    postgresql.org/message-id/20030721144428.GI2506@opencloud.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: oliver@opencloud.com, dmitry@openratings.com
  Subject: Re: Prepared Statements
  In-Reply-To: <20030721144428.GI2506@opencloud.com>
  References: <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> <20030721144428.GI2506@opencloud.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