From baa252a0edcb68f0bd4e4c64ee377822d890f026 Mon Sep 17 00:00:00 2001 From: yinxiaolog <43245392+yinxiaolog@users.noreply.github.com> Date: Fri, 24 May 2024 13:12:16 +0800 Subject: [PATCH] [DS-16046][fix] Set PreparedStatement parameter type (#16050) Fix the PreparedStatement parameter is TIME, set it to java.sql.Time Co-authored-by: Aaron Wang Co-authored-by: Rick Cheng --- .../dolphinscheduler/plugin/task/api/utils/ParameterUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ParameterUtils.java b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ParameterUtils.java index ea334125d5..3347297a46 100644 --- a/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ParameterUtils.java +++ b/dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ParameterUtils.java @@ -145,7 +145,7 @@ public class ParameterUtils { } else if (dataType.equals(DataType.DATE)) { stmt.setDate(index, java.sql.Date.valueOf(value)); } else if (dataType.equals(DataType.TIME)) { - stmt.setString(index, value); + stmt.setTime(index, java.sql.Time.valueOf(value)); } else if (dataType.equals(DataType.TIMESTAMP)) { stmt.setTimestamp(index, java.sql.Timestamp.valueOf(value)); } else if (dataType.equals(DataType.BOOLEAN)) {