You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Christian Hufgard <ch...@gmx.de> on 2006/04/23 11:41:55 UTC
Re[2]: [configuration] dbconfiguration
Hi Borut,
what exactly is the type you get, if you invoke
dbConfig.getProperty(someKeyAsString).getClass()?
> Anyway, I solved the problem differenly now.
In which way?
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [configuration] dbconfiguration
Posted by Oliver Heger <ol...@t-online.de>.
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
Re: [configuration] dbconfiguration
Posted by Borut Bolčina <bo...@najdi.si>.
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