提交 ac29f15f authored 作者: Philippe Marschall's avatar Philippe Marschall

Support TIMESTAMP_WITH_TIMEZONE 2014 JDBC type

While we currently support TIMESTAMP WITH TIME ZONE and OffsetDateTime
the corresponding JDBC type TIMESTAMP_WITH_TIMEZONE(2014) is not
supported when calling PreparedStatement.setObject(int, Object, int).
上级 3c0bc6c0
...@@ -902,6 +902,8 @@ public class DataType { ...@@ -902,6 +902,8 @@ public class DataType {
return Value.TIME; return Value.TIME;
case Types.TIMESTAMP: case Types.TIMESTAMP:
return Value.TIMESTAMP; return Value.TIMESTAMP;
case 2014: // Types.TIMESTAMP_WITH_TIMEZONE
return Value.TIMESTAMP_TZ;
case Types.BLOB: case Types.BLOB:
return Value.BLOB; return Value.BLOB;
case Types.CLOB: case Types.CLOB:
......
...@@ -682,6 +682,15 @@ public class TestPreparedStatement extends TestBase { ...@@ -682,6 +682,15 @@ public class TestPreparedStatement extends TestBase {
rs.next(); rs.next();
Object offsetDateTime2 = rs.getObject(1, LocalDateTimeUtils.getOffsetDateTimeClass()); Object offsetDateTime2 = rs.getObject(1, LocalDateTimeUtils.getOffsetDateTimeClass());
assertEquals(offsetDateTime, offsetDateTime2); assertEquals(offsetDateTime, offsetDateTime2);
assertFalse(rs.next());
rs.close();
prep.setObject(1, offsetDateTime, 2014); // Types.TIMESTAMP_WITH_TIMEZONE
rs = prep.executeQuery();
rs.next();
offsetDateTime2 = rs.getObject(1, LocalDateTimeUtils.getOffsetDateTimeClass());
assertEquals(offsetDateTime, offsetDateTime2);
assertFalse(rs.next());
rs.close(); rs.close();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论