setBoolean and char/varchar

Поиск
Список
Период
Сортировка
От Paulo Merson
Тема setBoolean and char/varchar
Дата
Msg-id 000d01c19eae$31d14160$c501a8c0@PAULO
обсуждение исходный текст
Список pgsql-jdbc
If you store '0' and '1' in a varchar(1) or char(1) column, you can read
false and true respectively using ResultSet.getBoolean. This is great,
especially if you are migrating from an Oracle database (shamefully
Oracle doesn't have a Boolean data type).

However, if you try to use PreparedStatement.setBoolean to set a value
used in the "where" clause to compare to that '0'-or-'1' varchar(1) or
char(1) column, then your select returns nothing.

Isn't this behavior inconsistent between getBoolean and setBoolean? Is
this a bug?

(Oracle jdbc driver does allow getBoolean and setBoolean with char(1)
and varchar2(1) consistently).

Thanks,

Paulo Merson
Summa Technologies - www.summa-tech.com


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

Предыдущее
От: "zhousj"
Дата:
Сообщение: jdbc bug
Следующее
От: "Vianen, Jeroen van"
Дата:
Сообщение: Re: Problem with getImportedKeys / getExportedKeys