stmt.setBinaryStream(i, lob.content, (int) lob.length);
} else {
stmt.setBinaryStream(i, lob.content, lob.length);
}
} catch (IOException e) {
throw new DatabaseException(e.getMessage(), e); // wrap
}
} else if(col.getValueClobFile() != null) {
try {
LOBContent<Reader> lob = toCharacterStream(col.getValueClobFile(), col.getEncoding());
if (lob.length <= Integer.MAX_VALUE) {
stmt.setCharacterStream(i, lob.content, (int) lob.length);
} else {
stmt.setCharacterStream(i, lob.content, lob.length);
}
} catch (IOException e) {
throw new DatabaseException(e.getMessage(), e); // wrap
}
} else {
// NULL values might intentionally be set into a change, we must also add them to the prepared statement
stmt.setNull(i, java.sql.Types.NULL);
}