[ 
https://issues.apache.org/jira/browse/GEODE-4922?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16410492#comment-16410492
 ] 

Darrel Schneider commented on GEODE-4922:
-----------------------------------------

Here is an example exception from postgres caused by passing a java.util.Date 
to setObject
{noformat}
Caused by: org.apache.geode.connectors.jdbc.JdbcConnectorException: Can't infer 
the SQL type to use for an instance of java.util.Date. Use setObject() with an 
explicit Types value to specify the type to use.

org.postgresql.util.PSQLException: Can't infer the SQL type to use for an 
instance of java.util.Date. Use setObject() with an explicit Types value to 
specify the type to use.

        at 
org.postgresql.jdbc.PgPreparedStatement.setObject(PgPreparedStatement.java:967)

        at 
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.setObject(HikariProxyPreparedStatement.java)

        at 
org.apache.geode.connectors.jdbc.internal.SqlHandler.setValuesInStatement(SqlHandler.java:123)

        at 
org.apache.geode.connectors.jdbc.internal.SqlHandler.executeWriteStatement(SqlHandler.java:175)

        at 
org.apache.geode.connectors.jdbc.internal.SqlHandler.write(SqlHandler.java:161){noformat}

> JDBC connector does not handle java.util.Date
> ---------------------------------------------
>
>                 Key: GEODE-4922
>                 URL: https://issues.apache.org/jira/browse/GEODE-4922
>             Project: Geode
>          Issue Type: Bug
>          Components: extensions, regions
>    Affects Versions: 1.4.0
>            Reporter: Darrel Schneider
>            Priority: Major
>
> Pdx types can have java.util.Date fields or object fields that contain 
> java.util.Date.
> When these are written that java.util.Date may cause a failure from the jdbc 
> driver if it does not support java.util.Date. Jdbc drivers must support 
> java.sql.Date, java.sql.Time, and java.sql.Timestamp but may not support 
> java.util.Date.
> The JDBC connector should convert java.util.Date to one of the java.sql 
> interfaces using the data type of the column to determine which one to 
> convert it to.
> When reading from jdbc back into geode if the pdx field is java.util.Date 
> then we should convert the java.sql.* instance to java.util.Date. It is also 
> possible we should do this conversion if the pdx field is of type object.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to