On Wed, Sep 10, 2008 at 8:35 PM, <[EMAIL PROTECTED]> wrote:
> I'm having a ConversionException issue when creating a RowSetDynaClass from a
> ResultSet. Apparently I'm not the only person's who's experienced this. The
> exception is saying "Cannot assign value of type 'java.lang.Integer' to
> property
> 'vsize' of type 'java.lang.Short'. Does somebody have a solution to this
> problem? I'm using Beanutils 1.8.
You could override the getObject(ResultSet, String) method and use
ConvertUtils to convert the value, something like:
protected Object getObject(ResultSet resultSet, String name) throws
SQLException {
Object value = super.getObject(resultSet, name);
DynaProperty property = getDynaProperty(name);
if (property != null) {
value = ConvertUtils.convert(value, property.getType());
}
return value;
}
I did something like this for BEANUTILS-142[1] - but then backed it
out - because it didn't solve that particular issue - and used another
solution. But perhaps I should have left that in as well.
Niall
[1] http://issues.apache.org/jira/browse/BEANUTILS-142
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]