[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>
This commit is contained in:
yinxiaolog 2024-05-24 13:12:16 +08:00 committed by GitHub
parent 581a7edad8
commit baa252a0ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)) {