Re: res.getInt() returns 0 for NULL?

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: res.getInt() returns 0 for NULL?
Дата
Msg-id Pine.LNX.4.33.0211070134280.30478-100000@leary.csoft.net
обсуждение исходный текст
Ответ на res.getInt() returns 0 for NULL?  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
Список pgsql-jdbc
This is according to the JDBC spec.  Check the API docs for getInt()

On Thu, 7 Nov 2002, Jean-Christian Imbeault wrote:

> Just need a clarification. When using res.getInt() on a column with a
> null value I am getting back "0", should I not get some error thrown or
> some kind or error instead?
>
> The following code illustrates:
>
> int id = res.getInt("id");
> if (res.wasNull()) {
>    System.out.println("result was null");
> }
> System.out.println("id is " + id);
>
> Output:
>
> result was null
> id is 0
>
>
> Thanks,
>
> Jc
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


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

Предыдущее
От: Jean-Christian Imbeault
Дата:
Сообщение: res.getInt() returns 0 for NULL?
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: