Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 526C31336971 for ; Tue, 7 Dec 2010 06:40:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 35376-10 for ; Tue, 7 Dec 2010 10:40:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id 28CF0133655C for ; Tue, 7 Dec 2010 06:40:06 -0400 (AST) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PPuxp-0000gL-Fk for pgsql-jdbc@postgresql.org; Tue, 07 Dec 2010 11:40:05 +0100 Received: from 94-225-240-18.access.telenet.be ([94.225.240.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Dec 2010 11:40:05 +0100 Received: from werner.donne by 94-225-240-18.access.telenet.be with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Dec 2010 11:40:05 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Werner =?utf-8?b?RG9ubsOp?= Subject: Re: binary data Date: Tue, 7 Dec 2010 10:35:05 +0000 (UTC) Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.225.240.18 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4) 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: 201012/34 X-Sequence-Number: 21272 > String query; > ResultSet resultSet; > > query = "SELECT content FROM tfile WHERE id=4"; > resultSet = null; > > try { > boolean more; > > resultSet = executeTheQuery(query); > more = resultSet.next(); > > if (more) { > InputStream is; > > is = resultSet.getBinaryStream("content"); > setContent(is); > } > } catch (SQLException anSQLException) { > } Hi, I have the same problem. I'm using PostgreSQL 9.0.1, which came with postgresql-8.4-701.jdbc4.jar. The database is using the UTF8-encoding. The getInputStream() method seems to return the encoded byte stream instead of the decoded one. Best regards, Werner.