Re: Prepared Statements

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Dmitry Tkach <dmitry(at)openratings(dot)com>
Cc: Oliver Jowett <oliver(at)opencloud(dot)com>, Kim Ho <kho(at)redhat(dot)com>, Barry Lind <blind(at)xythos(dot)com>, pgsql-jdbc-list <pgsql-jdbc(at)postgresql(dot)org>, Dave Cramer <Dave(at)micro-automation(dot)net>
Subject: Re: Prepared Statements
Date: 2003-07-21 14:39:33
Message-ID: 3F1BFB25.9000705@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Dmitry Tkach wrote:> 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.
>>
>>
> Why not just allow setObject() to take Collection as an argument?
> You would not need any special implementations then... and the
> application would not need to waste cycles on wrapping/unwrapping those
> Arrays every time...
>

That is an interesting idea. But how do we know the type of the elements that
should go in the list? We will just get java.Objects as we go through the
Collection.

--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dmitry Tkach 2003-07-21 14:43:28 Re: Prepared Statements
Previous Message Dmitry Tkach 2003-07-21 14:39:11 Re: Prepared Statements