Re: Problem with copyIn(String sql, Reader from) - Mailing list pgsql-jdbc

From Leonardo F
Subject Re: Problem with copyIn(String sql, Reader from)
Date
Msg-id 151556.7059.qm@web29010.mail.ird.yahoo.com
Whole thread Raw
In response to Problem with copyIn(String sql, Reader from)  (Leonardo F <m_lists@yahoo.it>)
Responses Re: Problem with copyIn(String sql, Reader from)  (Maciek Sakrejda <msakrejda@truviso.com>)
Re: Problem with copyIn(String sql, Reader from)  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Sorry, I meant

byte[] buf = encoding.encode(new String(cbuf, 0, len));



----- Messaggio originale -----
> Da: Leonardo F <m_lists@yahoo.it>
> A: pgsql-jdbc@postgresql.org
> Inviato: Gio 8 aprile 2010, 15:03:35
> Oggetto: [JDBC] Problem with copyIn(String sql, Reader from)
>
> Hi,


I tried to use copyIn(final String sql, Reader from) but I always
> got weird errors:

ERROR: invalid byte sequence for encoding "UTF8":
> 0x00



I think there's a problem in CopyManager.java, the
> line:


byte[] buf = encoding.encode(new
> String(cbuf));


should be

byte[] buf = encoding.encode(new
> String(len));


???

Otherwise the string to be encoded has
> always bufferSize length... filled with 0x0...


Am I
> right?

Everything works fine with the InputStream
> version.




pgsql-jdbc by date:

Previous
From: Leonardo F
Date:
Subject: Problem with copyIn(String sql, Reader from)
Next
From: Maciek Sakrejda
Date:
Subject: Re: Problem with copyIn(String sql, Reader from)