@@ -100,7 +100,7 @@ public void testJdbc41ResultSetMethods() throws SQLException {
100
100
+ "col2 varchar(512), " + "col3 float, " + "col4 decimal(10,5), " + "col5 uniqueidentifier, "
101
101
+ "col6 xml, " + "col7 varbinary(max), " + "col8 text, " + "col9 ntext, " + "col10 varbinary(max), "
102
102
+ "col11 date, " + "col12 time, " + "col13 datetime2, " + "col14 datetimeoffset, "
103
- + "col15 decimal(10,9), " + "col16 decimal(38,38), "
103
+ + "col15 decimal(10,9), " + "col16 decimal(38,38), " + "col17 json, "
104
104
+ "order_column int identity(1,1) primary key)" );
105
105
try {
106
106
@@ -120,12 +120,13 @@ public void testJdbc41ResultSetMethods() throws SQLException {
120
120
+ "'2017-05-19T10:47:15.1234567'," // col13
121
121
+ "'2017-05-19T10:47:15.1234567+02:00'," // col14
122
122
+ "0.123456789, " // col15
123
- + "0.1234567890123456789012345678901234567" // col16
123
+ + "0.1234567890123456789012345678901234567, " // col16
124
+ + "'{\" test\" :\" 123\" }'" // col17
124
125
+ ")" );
125
126
126
127
stmt .executeUpdate ("Insert into " + AbstractSQLGenerator .escapeIdentifier (tableName ) + " values("
127
128
+ "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null, "
128
- + "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null)" );
129
+ + "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null, " + "null )" );
129
130
130
131
try (ResultSet rs = stmt .executeQuery ("select * from "
131
132
+ AbstractSQLGenerator .escapeIdentifier (tableName ) + " order by order_column" )) {
@@ -223,7 +224,11 @@ public void testJdbc41ResultSetMethods() throws SQLException {
223
224
.compareTo (new BigDecimal ("0.12345678901234567890123456789012345670" )));
224
225
assertEquals (0 , rs .getObject ("col16" , BigDecimal .class )
225
226
.compareTo (new BigDecimal ("0.12345678901234567890123456789012345670" )));
226
-
227
+
228
+ String expectedJsonValue = "{\" test\" :\" 123\" }" ;
229
+ assertEquals (expectedJsonValue , rs .getObject (17 ).toString ());
230
+ assertEquals (expectedJsonValue , rs .getObject ("col17" ).toString ());
231
+
227
232
// test null values, mostly to verify primitive wrappers do not return default values
228
233
assertTrue (rs .next ());
229
234
assertNull (rs .getObject ("col1" , Boolean .class ));
@@ -284,6 +289,9 @@ public void testJdbc41ResultSetMethods() throws SQLException {
284
289
assertNull (rs .getObject (16 , BigDecimal .class ));
285
290
assertNull (rs .getObject ("col16" , BigDecimal .class ));
286
291
292
+ assertNull (rs .getObject (17 ));
293
+ assertNull (rs .getObject ("col17" ));
294
+
287
295
assertFalse (rs .next ());
288
296
}
289
297
} finally {
0 commit comments