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

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Віталій Тимчишин <tivv00(at)gmail(dot)com>, PG-JDBC Mailing List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Using java.lang.Character for "char" data type
Date: 2010-05-22 09:42:48
Message-ID: 4BF7A718.50607@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On 22/05/2010 6:16 AM, Kris Jurka wrote:

> It would be possible to support setObject for a Character, but be aware
> that "char" is not a character long, it's a byte long, so it will fail
> on multibyte characters.

So really the appropriate SQL type for Java 'Character' is varchar(1) ?
And a PostgreSQL 'char' (bpchar, not character(1)) maps best to a Java
'Byte' ?

--
Craig Ringer

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2010-05-22 09:57:32 Re: After server restart I get - An I/O error occured while sending to the backend.
Previous Message Thomas Kellerer 2010-05-22 08:20:08 Re: After server restart I get - An I/O error occured while sending to the backend.