[ 
https://issues.apache.org/jira/browse/BEANUTILS-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512504
 ] 

Niall Pemberton commented on BEANUTILS-142:
-------------------------------------------

I've added a test case which uses a proxy ResultSetMetaData impl. which returns 
the wrong class name (i.e. java.sql.Timestamp instead of java.sql.Date) and 
everything works fine for me. I can only get the "ConversionException: Cannot 
assign value..." issue you do when I remove my change to RowSetDynaClass which 
calls ConvertUtils. So the only explanation I have ATM is that you're using a 
version of bean utils prior to that change?

Also looking at your test results above - there seems to be two issues?

1) Oracles driver is incorrectly returning "java.sql.Timestamp" as the column 
class name for date columns (should be "java.sql.Date")
2) Oracles driver is incorrectly returning "oracle.sql.TIMESTAMP" as the column 
class name for timestamp columns (should be "java.sql.Timestamp");

So even if my ConvertUtils fix works to stop issue #1 from causing an exception 
- the end result (java.sql.Timestamp values instead of java.sql.Date in the 
DynaBean) still seems wrong to me. And for issue #2 we don't have a solution.

I would be interested to know what the ResultSetMetaData's getColumnType(idx) 
returned for the above - since if they return java.sql.Types.DATE and  
java.sql.Types.TIMESTAMP correctly then we could use that as the basis for a 
solution?
  

> [beanutils] RowSetDynaClass fails to copy resulset to DynaBean with Oracle 
> 10g JDBC driver
> ------------------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-142
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-142
>             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, Play.java
>
>
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to