Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 1FA7D6338BB for ; Tue, 7 Sep 2010 12:38:30 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 76659-04 for ; Tue, 7 Sep 2010 15:38:23 +0000 (UTC) X-Greylist: delayed 00:06:39.352639 by SQLgrey-1.7.6 Received: from mail.quinscape.de (mail.quinscape.de [212.29.44.217]) by mail.postgresql.org (Postfix) with ESMTP id B5BA0632B36 for ; Tue, 7 Sep 2010 12:38:22 -0300 (ADT) Received: (qmail-ldap/ctrl 30535 invoked from network); 7 Sep 2010 15:31:40 -0000 Received: from unknown (HELO [10.0.3.55]) ([10.0.3.55]) (envelope-sender ) by quinx.quinscape.de (qmail-ldap-1.03) with SMTP for ; 7 Sep 2010 15:31:40 -0000 Message-ID: <4C865AE5.5000906@quinscape.de> Date: Tue, 07 Sep 2010 17:31:49 +0200 From: Jochen Terstiege Organization: QuinScape GmbH User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: JDBC driver method setClob always uses getAsciiStream() Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/7 X-Sequence-Number: 20877 Using driver: postgresql-8.4-701.jdbc3.jar The method setClob() in the AbstractJdbc2Statement calls the method getAsciiStream() on the provided Clob. This leads to problems if the given Clob contains an UTF-8 encoded string. Shouldn't the driver call getCharacterStream() instead? Can this problem be solved in a different way? Relevant code from the class: public void setClob(int i, Clob x) throws SQLException { checkClosed(); if (x == null) { setNull(i, Types.CLOB); return; } InputStream l_inStream = x.getAsciiStream(); ...