Re: tightening up on use of oid 0

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: tightening up on use of oid 0
Дата
Msg-id 416DB1CA.5090005@opencloud.com
обсуждение исходный текст
Ответ на Re: tightening up on use of oid 0  ("Iain" <iain@mst.co.jp>)
Список pgsql-jdbc
Iain wrote:
> Hi,
>
> For my part, I've never used any of those calls.
>
> FWIW, I always use reference objects such as "Integer" as opposed to
> "int" so I've never done it that way. All calls to setObject or
> set<Anything> would always use a variable which is typed (and may be
> null) my assumption is that I avoid all such ambiguities that way.

Just to clarify.. these calls are typed:

   setInt(i, 42);
   setObject(i, new Integer(42));
   setObject(i, new Integer(42), Types.INTEGER);
   setObject(i, null, Types.INTEGER);
   setNull(i, Types.INTEGER);
   setObject(i, new PGline(...), Types.OTHER);

These calls are not (sufficiently) typed:

   setObject(i, null);
   setObject(i, (Integer)null);     // (*)
   setObject(i, null, Types.OTHER);
   setNull(i, Types.OTHER);

Types.OTHER on its own is not specific enough to identify a particular
backend type, and Java nulls have no inherent type ('instanceof' will
always return false).

 From your description it sounds like you may use the case marked (*) ?

-O

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

Предыдущее
От: "Tornroth, Phill"
Дата:
Сообщение: Re: FW: Question about the postgres resultset
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: tightening up on use of oid 0