db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: Oracle 9i BLOB malfunction / 4k mystery
Date Fri, 09 May 2003 05:52:13 GMT
Hi again Per-Olof,

Per-Olof Norén wrote:
> Thomas, Comitters,
> 
> The reason for my modification (as sketched below) of PlatformOracleImpl
> was to allow for both byte[] and java.lang.String in beans that is 
> mapped to clob field.
> 
> This is my last mod that is not handed back into ojb cvs.
> Is the project interested in me sending a patch for this?

Yes, that sounds great. I'd really apreciate a simple patch to the 4K 
problem. So I'm willing to commit your patch to CVS after reviewing it.

Could you please check if your solution does work for BLOB columns too?
If so we could put an end to this whole 4K story soon.

Currently Michael Mogley is also working on patch, but from what I saw 
last time his changes had a lot of impacts to many classes apart from 
PlatformOracleImpl. So I think the best thing is to compare both 
approaches and to take the solution with the least impact on the overall 
codebase.

cheers,
Thomas

> I (and our customer) would really appreciate this, since this
> would allow us to go with OJB 1.0 rcx releases , which is desired.
> 
> Thanx in advance,
> 
> Per-Olof Norén
> 
> 
> Per-Olof Norén wrote:
> 
>> Torsten Schlabach wrote:
>>
>>> Peer-Olof,
>>>
>>>>> Am I alone using oracle for storing blobs?
>>>
>>> Well, we have been trying the same for CLOBs. This issue seems to be the
>>> same on Oracle 8.x by the way.
>>
>>
>>
>> I actually made a change to get clobs to work:
>>
>> public void setObjectForStatement(PreparedStatement ps, int index, 
>> Object value, int sqlType) throws SQLException
>> }
>> .....skipping blob and double stuff.....
>>
>>  else if (sqlType == Types.CLOB)
>>         {
>>             Reader reader = null;
>>             int length = 0;
>>             if(value instanceof String)
>>             {
>>                 reader = new StringReader((String) value);
>>                 length = (((String) value)).length();
>>             } else if (value instanceof byte[])
>>             {
>>                 byte buf[] = (byte[]) value;
>>                 ByteArrayInputStream inputStream = new 
>> ByteArrayInputStream(buf);
>>                 reader = new InputStreamReader(inputStream);
>>             }
>>
>>             ps.setCharacterStream(index, reader, length);
>>         }
>>         else
>>         {
>>             super.setObjectForStatement(ps, index, value, sqlType);
>>         }
>>     }
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


Mime
View raw message