mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved ZonedDateTime support
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user