improved ZonedDateTime support

This commit is contained in:
高铁
2021-01-26 17:27:21 +08:00
parent c8bbfae175
commit 8d684f638c
2 changed files with 9 additions and 1 deletions
@@ -574,6 +574,11 @@ public class PreparedStatementProxyImpl extends StatementProxyImpl implements Pr
return;
}
if (className.equals("java.time.ZonedDateTime")) {
setParameter(parameterIndex, new JdbcParameterImpl(Types.TIMESTAMP, x));
return;
}
setParameter(parameterIndex, createParameter(Types.OTHER, null));
}
@@ -240,7 +240,7 @@ public final class JdbcUtils implements JdbcConstants {
} else {
out.print(Long.toString(value));
}
} else if (type == Types.TIMESTAMP) {
} else if (type == Types.TIMESTAMP || type == Types.TIMESTAMP_WITH_TIMEZONE) {
out.print(String.valueOf(rs.getTimestamp(columnIndex)));
} else if (type == Types.DECIMAL) {
out.print(String.valueOf(rs.getBigDecimal(columnIndex)));
@@ -379,6 +379,9 @@ public final class JdbcUtils implements JdbcConstants {
case Types.TIMESTAMP:
return "TIMESTAMP";
case Types.TIMESTAMP_WITH_TIMEZONE:
return "TIMESTAMP_WITH_TIMEZONE";
case Types.TINYINT:
return "TINYINT";