From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@postgresql.org
Subject: Re: standard LOB support
Date: Fri, 22 Jun 2007 09:11:00 +0200
Message-ID: <f5fsm4$q67$1@sea.gmane.org> (raw)
In-Reply-To: <01a901c7b497$7776bc40$4a0aa8c0@ipljp.local>
References: <f5fnkv$d0t$1@sea.gmane.org>
<01a901c7b497$7776bc40$4a0aa8c0@ipljp.local>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: spam_eater@gmx.net, pgsql-general@postgresql.org
Subject: Re: standard LOB support
In-Reply-To: <f5fsm4$q67$1@sea.gmane.org>
References: <f5fnkv$d0t$1@sea.gmane.org> <01a901c7b497$7776bc40$4a0aa8c0@ipljp.local> <f5fsm4$q67$1@sea.gmane.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox