geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Re: BLOB manipulation - question
Date Mon, 29 Nov 2004 01:59:53 GMT
On Nov 28, 2004, at 4:49 PM, Jeremy Boynes wrote:

> Gianny Damour wrote:
>> Hi,
>> I am working on the support of Dependent Value Classes.
>> The implementation is rather simple: if a binding is not explicitely  
>> defined for a CMP field class (see  
>> org.tranql.sql.jdbc.binding.BindingFactory) and if the class  
>> implements Serializable, then one assumes that the CMP field is a  
>> Dependent Value Class. Such CMP fields are stored into BLOB columns.
>> The serialized object is stored into the BLOB via the  
>> PreparedStatement.setBinaryStream(int parameterIndex,  
>> x, int length) method. As a matter of fact, this  
>> works with Derby. Yet, it seems that this is not the "correct" way.  
>> More accurately, it seems that PreparedStatement.setBlob (int i, Blob  
>> x) is the "correct" way.
>> Anyone knows if PreparedStatement.setBinaryStream is portable?
> LOBs in general are not very portable, especially with Oracle.
> The problem with setBlob() is that you need to have the driver create  
> an instance for you - you can't just pass in a class that implements  
> that interface. That usually involves executing the insert/update  
> statement with vendor specific SQL and then obtaining a LOB locator  
> either via another select or by using something like Oracle's  
> insert/returning.

Looks like you can do this without Oracle's specific sql or classes  
starting with 8.15 and the JDBC 3 drivers. 

I think there is still oracle specific sql for inserting a new empty  
blob (empty_blob() maybe).


View raw message