if (rs.wasNull()) {
ps.setNull(index, type);
return;
}
// Open file output stream
long millis = System.currentTimeMillis();
File f = File.createTempFile( [[#variable18c9c3e0]], "" + millis);
f.deleteOnExit();
FileOutputStream fos = new FileOutputStream(f);
if (log.isDebugEnabled()) {
// i18n[DBUtil.info.bindblobfile=bindBlobVarInFile: Opening temp file '{0}']
// i18n[DBUtil.info.bindclobfile=bindClobVarInFile: Opening temp file '{0}']
String msg = s_stringMgr.getString( [[#variable18cbdda0]], f.getAbsolutePath());
log.debug(msg);
}
// read rs input stream write to file output stream
byte[] buf = new byte[_prefs.getFileCacheBufferSize()];
int length = 0;
int total = 0;
while ((length = is.read(buf)) >= 0) {
if (log.isDebugEnabled()) {
// i18n[DBUtil.info.bindbloblength=bindBlobVarInFile: writing '{0}' bytes.]
// i18n[DBUtil.info.bindcloblength=bindClobVarInFile: writing '{0}' bytes.]
String msg = s_stringMgr.getString( [[#variable18c990c0]], Integer.valueOf(length));
log.debug(msg);
}
fos.write(buf, 0, length);
total += length;
}
fos.close();
// set the ps to read from the file we just created.
FileInputStream fis = new FileInputStream(f);
BufferedInputStream bis = new BufferedInputStream(fis);
|