db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per-Olof Norén <pe...@alma.nu>
Subject Re: Oracle 9i BLOB malfunction / 4k mystery
Date Thu, 08 May 2003 11:23:59 GMT
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?
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);
>         }
>     }




Mime
View raw message