Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id DB1FF9FB911 for ; Fri, 22 Jun 2007 04:12:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 89418-04 for ; Fri, 22 Jun 2007 04:11:57 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id D7D529FB548 for ; Fri, 22 Jun 2007 04:11:57 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1I1dIt-0000f2-3v for pgsql-general@postgresql.org; Fri, 22 Jun 2007 09:11:35 +0200 Received: from ppp-82-135-68-58.dynamic.mnet-online.de ([82.135.68.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jun 2007 09:11:35 +0200 Received: from spam_eater by ppp-82-135-68-58.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jun 2007 09:11:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-general@postgresql.org From: Thomas Kellerer Subject: Re: standard LOB support Date: Fri, 22 Jun 2007 09:11:00 +0200 Lines: 34 Message-ID: References: <01a901c7b497$7776bc40$4a0aa8c0@ipljp.local> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ppp-82-135-68-58.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070604 Thunderbird/2.0.0.4 Mnenhy/0.7.5.666 In-Reply-To: <01a901c7b497$7776bc40$4a0aa8c0@ipljp.local> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/1301 X-Sequence-Number: 116124 EBIHARA, Yuichiro wrote on 22.06.2007 08:34: > Thomas, > > Thank you for your comment. > >> I found that using getBinaryStream(), setBinaryStream(), >> getCharacterStream() >> and setCharacterStream() to handle LOBs across different DBMS >> is much more >> portable (and reliably) than using the Clob()/Blob() methods. > > According to JDBC 3.0 specifiction, those 4 methods may not be compatible to BLOB/CLOB. > Some databases may support them to access LOB data but not all databases. > Hmm. At least for updating LOBs, "my method" should be "legal". This is a quote from jdbc-3_0-fr-spec.pdf "The setBinaryStream and setObject methods may also be used to set a Blob object as a parameter in a PreparedStatement object. The setAsciiStream, setCharacterStream, and setObject methods are alternate means of setting a Clob object as a parameter." But I have to admit that I never read the specs in detail until now. Those methods were simply working fine (and were the only reliable way to handle LOBs with the Oracle drivers). Btw: these methods are working (for me) with Oracle, SQL Server (jTDS and MS Driver), DB2 (8.x), Firebird, Derby, MySQL, HSQL, H2, Informix and Sybase Adaptive Server Anywhere. But I do think that the exception thrown when using getClob() or getBlob() is an error in the JDBC driver. Maybe we should file an issue for this. Regards Thomas