Re: invalid byte sequence for encoding "UTF8": 0x00 - Mailing list pgsql-jdbc

From Altaf Malik
Subject Re: invalid byte sequence for encoding "UTF8": 0x00
Date
Msg-id 793207.12351.qm@web39108.mail.mud.yahoo.com
Whole thread Raw
In response to invalid byte sequence for encoding "UTF8": 0x00  ("James Im" <im-james@hotmail.com>)
Responses Re: invalid byte sequence for encoding "UTF8": 0x00
List pgsql-jdbc
Try to change the encoding of your database to "Unicode".
I hope this helps.
 
--Altaf Malik
EnterpriseDB

James Im <im-james@hotmail.com> wrote:
Hi,

I've got another problem. I sometimes get the following SQLException
when doing an insert:

ERROR: invalid byte sequence for encoding "UTF8": 0x00
Exception: org.postgresql.util.PSQLException
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1525)
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1309)
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:354)
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:308)

By the way, the insert is done with a PreparedStatement and I use only
setLong(), setString(), setTimestamp() and setInt().


I don't understand it very well. It is obviously an encoding exception
but I don't know why it happens and what I could do avoid it.

Any idea?

_________________________________________________________________
Opret en personlig blog og del dine billeder på MSN Spaces:
http://spaces.msn.com/


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly


Don't get soaked. Take a quick peak at the forecast
with theYahoo! Search weather shortcut.

pgsql-jdbc by date:

Previous
From: Altaf Malik
Date:
Subject: Re: how to continue using a connection after an error with autocommit=false
Next
From: Oliver Jowett
Date:
Subject: Re: invalid byte sequence for encoding "UTF8": 0x00