resultOut.addLobResult(resultLob);
}
parameterValues[i] = blob;
} else if (parameterTypes[i].typeCode == Types.SQL_CLOB) {
long id;
ClobDataID clob = null;
if (value instanceof JDBCClobClient) {
// check or fix id mismatch
clob = ((JDBCClobClient) value).clob;
id = clob.getId();
} else if (value instanceof Clob) {
long length = ((Clob) value).length();
Reader reader = ((Clob) value).getCharacterStream();
clob = session.createClob(length);
id = clob.getId();
ResultLob resultLob =
ResultLob.newLobCreateClobRequest(session.getId(), id,
reader, length);
session.allocateResultLob(resultLob, null);
resultOut.addLobResult(resultLob);
} else if (value instanceof Reader) {
long length = streamLengths[i];
clob = session.createClob(length);
id = clob.getId();
Reader reader = (Reader) value;
ResultLob resultLob =
ResultLob.newLobCreateClobRequest(session.getId(), id,
reader, length);