use of javax.sql.rowset.serial.SerialBlob in project teiid by teiid.
the class BlobType method readReference.
@Override
protected void readReference(ObjectInput in) throws IOException {
byte[] bytes = new byte[(int) getLength()];
in.readFully(bytes);
try {
this.reference = new SerialBlob(bytes);
} catch (SQLException e) {
throw new IOException(e);
}
}
use of javax.sql.rowset.serial.SerialBlob in project teiid by teiid.
the class TestJSONProcessing method testJSONParseBlob.
@Test
public void testJSONParseBlob() throws Exception {
HardcodedDataManager dataManager = new HardcodedDataManager();
// $NON-NLS-1$
String sql = "select jsonParse(cast(? as blob), false) x";
String json = "{\"name\":123}";
List<?>[] expected = new List[] { Arrays.asList(json) };
processPreparedStatement(sql, expected, dataManager, new DefaultCapabilitiesFinder(), RealMetadataFactory.example1Cached(), Arrays.asList(new BlobType(new SerialBlob(json.getBytes(Charset.forName("UTF-16BE"))))));
}
Aggregations