Re: JDBC and Latin1 Database problem - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: JDBC and Latin1 Database problem
Date
Msg-id 41DB5719.5080702@opencloud.com
Whole thread Raw
In response to JDBC and Latin1 Database problem  ("David Gagnon" <dgagnon74@hotmail.com>)
Responses Re: JDBC and Latin1 Database problem
List pgsql-jdbc
David Gagnon wrote:

> To inform the jdbc driver that it must converts caracters I put the
> following URL in my server.xml (notice the encoding=latin1).  Without
> this variable caracter é takes 2 spaces in the latin db.  So éééééé will
> takes 12 spaces.  This make my varchar(10) to small.

> jdbc:postgresql://127.0.0.1:5432/webCatalog?encoding=latin1

The 'encoding' parameter is only used for connections to pre-7.3
servers; in other cases it is ignored.

What is the database encoding? ("SHOW server_encoding")

>  Error executing: INSERT INTO AK  (AKNUM,AKDESC_PRI,
> AKDESC_SEC,AKFRAIS,AKTAUX,AKTYPE) VALUES
> ('CHEQ','CH?QUE','CHEQUE',22,null,1)
> org.postgresql.util.PSQLException: ERROR: could not convert UTF-8
> character 0x00ef to ISO8859-1

Are you constructing this entire query string yourself, or are you using
a PreparedStatement with parameters?

Can you show us some sample code that demonstrates the problem?

-O

pgsql-jdbc by date:

Previous
From: "David Gagnon"
Date:
Subject: JDBC and Latin1 Database problem
Next
From: "David Gagnon"
Date:
Subject: Re: JDBC and Latin1 Database problem