// Insert a Blob
PreparedStatement ps = prepareStatement(
"insert into BLOBCLOB(ID, BLOBDATA) values(?,?)");
int id = BlobClobTestSetup.getID();
ps.setInt(1, id);
ps.setBinaryStream(2, new LoopingAlphabetStream(length), length);
ps.execute();
ps.close();
// Get last byte from the source stream.
InputStream cmpIs = new LoopingAlphabetStream(length);
cmpIs.skip(length -1);
int srcLastByte = cmpIs.read();
assertTrue(cmpIs.read() == -1);
// Read everything first.
int bytesToRead = 5000;
ps = prepareStatement("select BLOBDATA from BLOBCLOB where ID=?");
ps.setInt(1, id);