xtern commented on code in PR #2031:
URL: https://github.com/apache/ignite-3/pull/2031#discussion_r1191937590


##########
modules/jdbc/src/main/java/org/apache/ignite/internal/jdbc/JdbcPreparedStatement.java:
##########
@@ -719,6 +721,32 @@ private void setArgument(int paramIdx, Object val) throws 
SQLException {
         currentArgs.set(paramIdx - 1, val);
     }
 
+    /**
+     * Converts value of JDBC type to value of Ignite Client protocol types.
+     *
+     * <ul>
+     *     <li>java.sql.* to Java Time API</li>
+     * </ul>
+     */
+    private @Nullable Object convertJdbcTypeToInternal(@Nullable Object val) {
+        if (val instanceof java.util.Date) {
+            if (val instanceof Timestamp) {
+                Timestamp timeStamp = (Timestamp) val;
+                return timeStamp.toLocalDateTime();
+            } else if (val instanceof Date) {
+                Date date = (Date) val;
+                return date.toLocalDate();
+            } else if (val instanceof Time) {
+                Time time = (Time) val;
+                return time.toLocalTime();
+            }
+
+            return ((java.util.Date) val).toInstant();

Review Comment:
   In what case will we execute this line of code?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to