Re: Using java.lang.Character for "char" data type

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Using java.lang.Character for "char" data type
Дата
Msg-id alpine.BSO.2.00.1005241406480.1152@leary.csoft.net
обсуждение исходный текст
Ответ на Re: Using java.lang.Character for "char" data type  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-jdbc

On Sat, 22 May 2010, Craig Ringer wrote:

> So really the appropriate SQL type for Java 'Character' is varchar(1) ?

Yes.

>  And a PostgreSQL 'char' (bpchar, not character(1)) maps best to a Java
> 'Byte' ?

I'm not so sure about that.  "char" is still intended to represent a
textual identifier, not a numeric value as Byte does.  Additionally you
can't store 0 in a "char".

When you're talking about a mapping there's two directions, setObject and
getObject, and they're not always symmetric.  If we allowed setObject with
a Character to map to varchar, then I would not expect getObject to return
a Character, I'd expect a String.

Kris Jurka

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: After server restart I get - An I/O error occured while sending to the backend.
Следующее
От: Altaf Malik
Дата:
Сообщение: Function with raise notice statements taking too long