openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Bauer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENJPA-1907) Exact type of date-valued parameter not preserved during prepared query reparameterization
Date Thu, 16 Dec 2010 20:15:00 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-1907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972194#action_12972194
] 

Jeremy Bauer commented on OPENJPA-1907:
---------------------------------------

Committed a simple fix to 2.1.x and trunk which maps a java.util.Date parameter value to a
java.sql.Date parameter value when using DB2 on z/OS.  The default behavior was to map java.util.Date
to a java.sql.Timestamp and that results in a SQLException on this platform.

> Exact type of date-valued parameter not preserved during prepared query reparameterization
> ------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-1907
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1907
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Pinaki Poddar
>            Assignee: Jeremy Bauer
>
> Date valued query parameter such as java.util.Date gets bound as timestamp during prepared
query reparametrization. Though the parameter value carries the exact type, the prepared query
executor when binds the value via DBDictionary setDate(...) -- the logic defaults the value
to be bound to the JDBC statement as Timestamp. DB2 database does not like the type change
and returns wrong result --   MySQL/Derby etc tolarates the type change and gets correct result.

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


Mime
View raw message