Re: IN clauses via setObject(Collection) [Was: Re: Prepared Statements]

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: IN clauses via setObject(Collection) [Was: Re: Prepared Statements]
Дата
Msg-id 20030721161406.GA9307@opencloud.com
обсуждение исходный текст
Ответ на IN clauses via setObject(Collection) [Was: Re: Prepared Statements]  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: IN clauses via setObject(Collection) [Was: Re: Prepared  (Dmitry Tkach <dmitry@openratings.com>)
Список pgsql-jdbc
On Tue, Jul 22, 2003 at 03:47:49AM +1200, Oliver Jowett wrote:
> On Mon, Jul 21, 2003 at 11:26:11AM -0400, Fernando Nasser wrote:
>
> > I think Dima is arguing that Collection could be treated as an special case
> > where it indicates a list of something instead of a single something.
> >
> > So, we would iterate through this Collection using its iterator and, for
> > each Object obtained, act like a setObject has been used with that Object
> > and the JAVA TYPE as an argument.
> >
> > The Types.OTHER is used for database specific SQL types or for Dynamic Data
> > Access support.  As the Collection class is not a data type there is no
> > chance of confusion.
>
> Ya, I understand. My main objection is that setObject(n, object,
> Types.INTEGER), in all other cases, means "interpret object as an integer,
> or fail if it can't be cast in that way".

Also.. what would we do with this object?

public class AnnoyingObject implements java.util.Collection, java.sql.Array {
  // ...
}

then setObject(n, new AnnoyingObject(), Types.ARRAY);

Is that an Array, or an IN clause of Arrays? :)

(Array is the obvious candidate for also being a Collection, but potentially
you could do it with other types too)

-O

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Fernando Nasser
Дата:
Сообщение: Re: RFC: Removal of support for JDBC1 drivers.
Следующее
От: Fernando Nasser
Дата:
Сообщение: Re: RFC: Removal of support for JDBC1 drivers.