this.setColumn(LOBstatement, currentIndex, request, keys[i]);
currentIndex++;
}
}
OracleResultSet set = (OracleResultSet) LOBstatement.executeQuery();
if (set.next()) {
int index = 0;
for (int i = 0; i < values.length; i++) {
String type = values[i].getAttribute("type", "");
if (this.isLargeObject(type)) {
Object attr = request.get(values[i].getAttribute("param"));
int length = -1;
InputStream stream = null;
OutputStream output = null;
int bufSize = 1024;
index++;
if (type.equals("ascii")) {
CLOB ascii = set.getCLOB(index);
if (attr instanceof File) {
File asciiFile = (File) attr;
stream = new BufferedInputStream(new FileInputStream(asciiFile));
} else {
String asciiText = (String) attr;
stream = new BufferedInputStream(new ByteArrayInputStream(asciiText.getBytes()));
}
output = new BufferedOutputStream(ascii.getAsciiOutputStream());
bufSize = ascii.getBufferSize();
} else {
BLOB binary = set.getBLOB(index);
File binaryFile = (File) attr;
stream = new BufferedInputStream(new FileInputStream(binaryFile));
length = (int) binaryFile.length();
output = new BufferedOutputStream(binary.getBinaryOutputStream());
bufSize = binary.getBufferSize();
}
byte[] buffer = new byte[bufSize];
while ((length = stream.read(buffer)) != -1) {
output.write(buffer, 0, length);
}
stream.close();
output.close();
}
}
}
set.close();
set.getStatement().close();
}
conn.commit();
} catch (Exception e) {
if (conn != null) {