resultOut.addLobResult(resultLob);
}
parameterValues[i] = blob;
} else if (parameterTypes[i].typeCode == Types.SQL_CLOB) {
long id;
ClobDataID clob = null;
if (value instanceof JDBCClobClient) {
// 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 = connection.sessionProxy.createClob(length);
id = clob.getId();
ResultLob resultLob = ResultLob.newLobCreateClobRequest(
connection.sessionProxy.getId(), id, reader, length);
connection.sessionProxy.allocateResultLob(resultLob, null);
resultOut.addLobResult(resultLob);
} else if (value instanceof Reader) {
long length = streamLengths[i];
clob = connection.sessionProxy.createClob(length);
id = clob.getId();
Reader reader = (Reader) value;
ResultLob resultLob = ResultLob.newLobCreateClobRequest(
connection.sessionProxy.getId(), id, reader, length);