Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ private static Row transform(List<String> ors, RowDesc desc, oracle.jdbc.OracleR

private static Class<?> getType(String cn) {
try {
if (cn.equals(byte[].class.getName())) {
return byte[].class;
}
return OraclePreparedQueryCommand.class.getClassLoader().loadClass(cn);
} catch (ClassNotFoundException e) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,28 @@ private <T> void testDecode(TestContext ctx, String columnName, JDBCType jdbcTyp
}));
}

private void testDecodeUsingStream(TestContext ctx, String columnName, JDBCType jdbcType, Buffer expected) {
pool.getConnection(ctx.asyncAssertSuccess(conn -> {
conn.prepare("SELECT " + columnName + " FROM binary_data_types WHERE id = 1")
.onComplete(ctx.asyncAssertSuccess(preparedStatement -> {
preparedStatement.cursor().read(10).onComplete(ctx.asyncAssertSuccess(result -> {
ctx.assertEquals(1, result.size());
Row row = result.iterator().next();
ctx.assertEquals(expected, row.get(Buffer.class, 0));
ctx.assertEquals(expected, row.get(Buffer.class, columnName));
ColumnDescriptor columnDescriptor = result.columnDescriptors().get(0);
ctx.assertEquals(jdbcType, columnDescriptor.jdbcType());
ctx.assertNotNull(columnDescriptor);
}));
}));
}));
}

@Test
public void testDecodeRawUsingStream(TestContext ctx) {
testDecodeUsingStream(ctx, "test_raw", JDBCType.VARBINARY, Buffer.buffer("See you space cowboy..."));
}

@Test
public void testEncodeNull(TestContext ctx) {
pool
Expand Down
Loading