JdbcUtils.getResultSetValue avoids re-retrieval from ResultSet for Blob/Clob content (for Derby compatibility)

Issue: SPR-8810
This commit is contained in:
Juergen Hoeller 2014-10-28 16:19:16 +01:00
parent 06632822e9
commit c0747a006a
1 changed files with 4 additions and 2 deletions

View File

@ -239,10 +239,12 @@ public abstract class JdbcUtils {
className = obj.getClass().getName();
}
if (obj instanceof Blob) {
obj = rs.getBytes(index);
Blob blob = (Blob) obj;
obj = blob.getBytes(1, (int) blob.length());
}
else if (obj instanceof Clob) {
obj = rs.getString(index);
Clob clob = (Clob) obj;
obj = clob.getSubString(1, (int) clob.length());
}
else if ("oracle.sql.TIMESTAMP".equals(className) || "oracle.sql.TIMESTAMPTZ".equals(className)) {
obj = rs.getTimestamp(index);