db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert S. Sfeir" <rob...@codepuccino.com>
Subject Re: PlatformDefaultImpl in RC5 throwing ClassCastException
Date Mon, 02 Feb 2004 13:39:44 GMT
HELLO?  Anyone? Buller?  Anything on this?  Is this the right solution?  
All the JUnit tests pass, and I've tested my code on postgres and mysql 
too, but these wouldn't break since this looks like an Oracle specific 
issue.

R


Robert S. Sfeir wrote:

> OOPS
>
> Robert S. Sfeir wrote:
>
>> Ok, for now (I don't know if this is the right fix, but I'm using it 
>> for now for myself)
>>
>> I changed the method to look like this:
>> PlatformDefaultImpl line 255
>>
>> public void setObjectForStatement(PreparedStatement ps, int index, 
>> Object value, int sqlType)
>>            throws SQLException
>>    {
>>        if ((value instanceof String) && (sqlType == Types.LONGVARCHAR))
>>        {
>>            String s = (String) value;
>>            ps.setCharacterStream(index, new StringReader(s), 
>> s.length());
>>        }
>
>
> this should be:
>        else if ((value instanceof String)) // Why are we setting 
> Object if value is a String?
>       {
>           ps.setString( index, value.toString());
>       }
>
>>
>>        if ((value instanceof String)) // Why are we setting Object if 
>> value is a String?
>>        {
>>            ps.setString( index, value.toString());
>>        }
>>        else
>>        {
>>            ps.setObject(index, value, sqlType);
>>        }
>>    }
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org



---------------------------------------------------------------------
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