Skip to content

Commit

Permalink
TEIID-4512: Issue with older drivers and useStreamsForLobs (calling t…
Browse files Browse the repository at this point in the history
…he old method if possible)
  • Loading branch information
shawkins authored and johnathonlee committed Aug 1, 2018
1 parent 354106d commit 07c1109
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Expand Up @@ -224,6 +224,13 @@ <h2 class="western"><a name="Compatibility"></a>Compatibility Issues</h2>

<h4 class="western">from ${project.version}</h4>
<ul>
<li/>
<p style="margin-bottom: 0in">
<a href='https://issues.jboss.org/browse/TEIID-4512'>TEIID-4512</a> - Issue with older drivers and useStreamsForLobs (calling the old method if possible)
</ul>

<h4 class="western">from 8.12.14.6_4</h4>
<ul>
<li/>
<p style="margin-bottom: 0in">
<a href='https://issues.jboss.org/browse/TEIID-3750'>TEIID-3750</a> - Allow the parsing of an expression (allowing the direct parsing of an expression as a default)
Expand Down
Expand Up @@ -943,12 +943,22 @@ public void bindValue(PreparedStatement stmt, Object param, Class<?> paramType,
if (useStreamsForLobs()) {
if (param instanceof Blob) {
Blob blob = (Blob)param;
stmt.setBinaryStream(i, blob.getBinaryStream(), blob.length());
long length = blob.length();
if (length <= Integer.MAX_VALUE) {
stmt.setBinaryStream(i, blob.getBinaryStream(), (int)length);
} else {
stmt.setBinaryStream(i, blob.getBinaryStream(), length);
}
return;
}
if (param instanceof Clob) {
Clob clob = (Clob)param;
stmt.setCharacterStream(i, clob.getCharacterStream(), clob.length());
long length = clob.length();
if (length <= Integer.MAX_VALUE) {
stmt.setCharacterStream(i, clob.getCharacterStream(), (int)clob.length());
} else {
stmt.setCharacterStream(i, clob.getCharacterStream(), length);
}
return;
}
}
Expand Down

0 comments on commit 07c1109

Please sign in to comment.