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

Henri Yandell commented on BEANUTILS-142:
-----------------------------------------

Definitely two issues.

On your fix; it turns out that I was running the new code, but it was not 
executing it. I didn't have commons-logging in the classpath, and the 
catch(Throwable t) { } was hiding that. Is there any reason for that try/catch? 
Can we remove it?

On 1)....

This is a tricky one. Oracle's DATE type can contain both date and time parts. 
Its TIMESTAMP type lets you get down to milliseconds (and to smaller units than 
JDBC types usually handle). So DATE -> java.sql.Timestamp is completely correct 
from a mapping point of view. I think there's nothing more to do here -  people 
have to know about the database they're dealing with to use DynaBeans.

2) Obvious solutions to this are:

  i) Fix JDBC driver. Could start another project to make a 'fix the stinking 
oracle jdbc driver via a wrapper'. Have always had an urge to do that :)

 ii) Convert the oracle.sql.TIMESTAMP to a java.sql.Timestamp. The problem here 
is that this means a) changing JDBCDynaClass so that createDynaProperty 
silently converts oracle.sql.TIMESTAMP to java.sql.Timestamp; and secondly, 
that we then have a converter in place to do oracle.sql.TIMESTAMP to 
java.sql.Timestamp. The problem with that last step is that our converter is 
Class based and not String based. Still.... *playing with that idea*



> [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-oracle-bug.patch, 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