commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <>
Subject [jira] Updated: (BEANUTILS-142) [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 10g JDBC driver
Date Fri, 13 Jul 2007 01:07:05 GMT


Henri Yandell updated BEANUTILS-142:


Test case for this bug. It shows that there is a problem with DATE columns being loaded as
originally said. I don't think an Exception is thrown for TIMESTAMP->oracle.sql.TIMESTAMP.
Instead the user gets an oracle.sql.TIMESTAMP object instead of the expected java.sql.Timestamp.

We should a) Fix the exception and b) Probably tidy up a bit so users don't get the oracle

Here is the output:

metadata - java.sql.Date? java.sql.Timestamp
metadata - java.sql.Timestamp? oracle.sql.TIMESTAMP
getDate - java.sql.Date? class java.sql.Date
getObject - java.sql.Date? class java.sql.Date
getTimestamp - java.sql.Timestamp? class java.sql.Timestamp
getObject - java.sql.Timestamp? class oracle.sql.TIMESTAMP
Exception in thread "main" org.apache.commons.beanutils.ConversionException: Cannot assign
value of type 'java.sql.Date' to property 'test_date' of type 'java.sql.Timestamp'
        at org.apache.commons.beanutils.BasicDynaBean.set(
        at org.apache.commons.beanutils.RowSetDynaClass.copy(
        at org.apache.commons.beanutils.RowSetDynaClass.<init>(
        at org.apache.commons.beanutils.RowSetDynaClass.<init>(
        at jdbc.Play.main(

> [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 10g JDBC driver
> ------------------------------------------------------------------------------------------
>                 Key: BEANUTILS-142
>                 URL:
>             Project: Commons BeanUtils
>          Issue Type: Bug
>          Components: DynaBean
>         Environment: Operating System: Windows XP
> Platform: All
>            Reporter: Li Zhang
>            Assignee: Henri Yandell
>             Fix For: 1.8.0
>         Attachments: Beanutils-142.patch,
> Beginning in Oracle 9.2, DATE is mapped to Date and TIMESTAMP is mapped to
> Timestamp. However if you were relying on DATE values to contain time
> information, there is a problem. When using Oracle 10g JDBC driver, the
> ResultSetMetaData.getColumnClassName returns java.sql.Timestamp but
> ResultSet.getObject(name).getClass() returns java.sql.Date. Obviously these two
> do not match each other. When the RowSetDynaClass.copy function tries to set the
> value to BasicDynaBean, it throws exception. Need a workaround.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message