[ 
https://issues.apache.org/jira/browse/DBUTILS-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benedikt Ritter updated DBUTILS-118:
------------------------------------

    Description: 
We are calling an SP to retrieve a timestamp from the DB but the mapping of the 
nano seconds is not being done correctly. Only milliseconds are being returned 
although the SP is returning the nano seconds.
After debugging through the apache db utils, we found that in the class 
BeanProcessor (method callSetter), the setting of timestamp is not being done 
properly:

{code:java}
if ("java.sql.Timestamp".equals(targetType)) {
     value = new java.sql.Timestamp(((java.util.Date) value).getTime());
 }
{code}

We have modified the codes as follows so as to get the nano seconds:

{code:java}
if ("java.sql.Timestamp".equals(targetType))
{
 int nanos = ((Timestamp) value).getNanos(); 
value = new java.sql.Timestamp(((Timestamp) value).getTime());
 ((Timestamp) value).setNanos(nanos); 
} 
{code}

Can you please provide a fix as soon as possible. (v1.6 would be great)


  was:
We are calling an SP to retrieve a timestamp from the DB but the mapping of the 
nano seconds is not being done correctly. Only milliseconds are being returned 
although the SP is returning the nano seconds.
After debugging through the apache db utils, we found that in the class 
BeanProcessor (method callSetter), the setting of timestamp is not being done 
properly:

if ("java.sql.Timestamp".equals(targetType)) {
     value = new java.sql.Timestamp(((java.util.Date) value).getTime());
 }

We have modified the codes as follows so as to get the nano seconds:

if ("java.sql.Timestamp".equals(targetType))
{
 int nanos = ((Timestamp) value).getNanos(); 
value = new java.sql.Timestamp(((Timestamp) value).getTime());
 ((Timestamp) value).setNanos(nanos); 
} 

Can you please provide a fix as soon as possible. (v1.6 would be great)



> BeanProcessor not returning nanoseconds
> ---------------------------------------
>
>                 Key: DBUTILS-118
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-118
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Feysal Rujbally
>            Priority: Blocker
>             Fix For: 1.6
>
>         Attachments: vcs-diff8964305076305734485.patch
>
>
> We are calling an SP to retrieve a timestamp from the DB but the mapping of 
> the nano seconds is not being done correctly. Only milliseconds are being 
> returned although the SP is returning the nano seconds.
> After debugging through the apache db utils, we found that in the class 
> BeanProcessor (method callSetter), the setting of timestamp is not being done 
> properly:
> {code:java}
> if ("java.sql.Timestamp".equals(targetType)) {
>      value = new java.sql.Timestamp(((java.util.Date) value).getTime());
>  }
> {code}
> We have modified the codes as follows so as to get the nano seconds:
> {code:java}
> if ("java.sql.Timestamp".equals(targetType))
> {
>  int nanos = ((Timestamp) value).getNanos(); 
> value = new java.sql.Timestamp(((Timestamp) value).getTime());
>  ((Timestamp) value).setNanos(nanos); 
> } 
> {code}
> Can you please provide a fix as soon as possible. (v1.6 would be great)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to