Browse Source

[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 <wangweirao16@gmail.com>
Co-authored-by: Rick Cheng <rickchengx@gmail.com>
upstream-dev
yinxiaolog 5 months ago committed by GitHub
parent
commit
baa252a0ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/utils/ParameterUtils.java

2
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)) { } else if (dataType.equals(DataType.DATE)) {
stmt.setDate(index, java.sql.Date.valueOf(value)); stmt.setDate(index, java.sql.Date.valueOf(value));
} else if (dataType.equals(DataType.TIME)) { } else if (dataType.equals(DataType.TIME)) {
stmt.setString(index, value); stmt.setTime(index, java.sql.Time.valueOf(value));
} else if (dataType.equals(DataType.TIMESTAMP)) { } else if (dataType.equals(DataType.TIMESTAMP)) {
stmt.setTimestamp(index, java.sql.Timestamp.valueOf(value)); stmt.setTimestamp(index, java.sql.Timestamp.valueOf(value));
} else if (dataType.equals(DataType.BOOLEAN)) { } else if (dataType.equals(DataType.BOOLEAN)) {

Loading…
Cancel
Save