commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@t-online.de>
Subject Re: [configuration] dbconfiguration
Date Sun, 23 Apr 2006 16:09:44 GMT
You probably get an instance of an implementation of the java.sql.Blob
interface specific to your JDBC driver. This causes the ClassCastException.

A possible solution could be to create a new class derived from
DatabaseConfiguration and overload the getProperty() method. In this
method you first call the super method and then check if its result is
of type java.sql.Blob. If this is the case, you can use the methods of
the Blob interface to extract the data and return it as String. I assume
this would work.

Oliver

Borut BolĨina wrote:

> Christian Hufgard pravi:
>
>> Hi Borut,
>>
>> what exactly is the type you get, if you invoke
>> dbConfig.getProperty(someKeyAsString).getClass()?
>>   
>
> Casting to String threw ClassCastException. I removed the code
> completely (actualy it lives in byte heavens = svn), so I won't be
> able to answer this question as it would mean reconstructing previous
> enviroment.
>
>>  
>>
>>> Anyway, I solved the problem differenly now.
>>>     
>>
>>
>> In which way?
>>   
>
> Design change. I am not using dbconfiguration anymore, as application
> requirements changed, but I of course continue to use
> CompositeConfiguration for different purposes. Now I use Cayenne for
> storing values which were before in serialized XML.
>
>> Christian
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>   
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message