Re: Question about encoding - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Question about encoding
Date
Msg-id 40D628F2.7070601@opencloud.com
Whole thread Raw
In response to Question about encoding  (André Gomes <andre@dsc.ufcg.edu.br>)
List pgsql-jdbc
André Gomes wrote:

> I'm trying to insert some text with chars like 'ã', 'õ'. I'm using a
> postgres database with the LATIN10 encoding, but when I try to make a
> INSERT statement via JDBC these chars aren't insert into the database,
> they are replaced by '?'. Could you help me with this question. Is this
> a problem with the JDBC driver ? or with the database itself ?

What server and driver version are you using? Are the characters in
question directly in the query string or set as a parameter via
PreparedStatement.setString()?

There is no equivalent Java encoding for LATIN10, according to a comment
in the driver (is this still true?). If you are using a pre-7.3 server,
the encoding from Java strings to the database encoding happens on the
driver side, so in this case the driver can't find a suitable encoding
to use and just uses the JVM's default encoding, which is probably wrong.

-O

pgsql-jdbc by date:

Previous
From: André Gomes
Date:
Subject: Question about encoding
Next
From: Kris Jurka
Date:
Subject: Re: ResultSet.updateCharacterStream