conn = reconnect(conn);
ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM TEST ORDER BY ID");
while (rs.next()) {
int i = rs.getInt("ID");
Blob b = rs.getBlob("B");
Clob c = rs.getClob("C");
int l = i;
assertEquals(l, b.length());
assertEquals(l, c.length());
assertEqualStreams(getRandomStream(l, i), b.getBinaryStream(), -1);
assertEqualReaders(getRandomReader(l, i), c.getCharacterStream(), -1);
}
prep = conn.prepareStatement("UPDATE TEST SET B=?, C=? WHERE ID=?");
for (int i = first; i < len; i += increment) {
int l = i;
prep.setBinaryStream(1, getRandomStream(l, -i), -1);
prep.setCharacterStream(2, getRandomReader(l, -i), -1);
prep.setInt(3, i);
prep.execute();
}
conn = reconnect(conn);
rs = conn.createStatement().executeQuery("SELECT * FROM TEST ORDER BY ID");
while (rs.next()) {
int i = rs.getInt("ID");
Blob b = rs.getBlob("B");
Clob c = rs.getClob("C");
int l = i;
assertEquals(l, b.length());
assertEquals(l, c.length());
assertEqualStreams(getRandomStream(l, -i), b.getBinaryStream(), -1);
assertEqualReaders(getRandomReader(l, -i), c.getCharacterStream(), -1);
}
conn.close();
}