|
|
|
@ -60,11 +60,15 @@ public class TemporaryLobCreator implements LobCreator { |
|
|
|
public void setBlobAsBytes(PreparedStatement ps, int paramIndex, @Nullable byte[] content) |
|
|
|
public void setBlobAsBytes(PreparedStatement ps, int paramIndex, @Nullable byte[] content) |
|
|
|
throws SQLException { |
|
|
|
throws SQLException { |
|
|
|
|
|
|
|
|
|
|
|
Blob blob = ps.getConnection().createBlob(); |
|
|
|
if (content != null) { |
|
|
|
blob.setBytes(1, content); |
|
|
|
Blob blob = ps.getConnection().createBlob(); |
|
|
|
|
|
|
|
blob.setBytes(1, content); |
|
|
|
this.temporaryBlobs.add(blob); |
|
|
|
this.temporaryBlobs.add(blob); |
|
|
|
ps.setBlob(paramIndex, blob); |
|
|
|
ps.setBlob(paramIndex, blob); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
ps.setBlob(paramIndex, (Blob) null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
logger.debug(content != null ? "Copied bytes into temporary BLOB with length " + content.length : |
|
|
|
logger.debug(content != null ? "Copied bytes into temporary BLOB with length " + content.length : |
|
|
|
@ -103,11 +107,15 @@ public class TemporaryLobCreator implements LobCreator { |
|
|
|
public void setClobAsString(PreparedStatement ps, int paramIndex, @Nullable String content) |
|
|
|
public void setClobAsString(PreparedStatement ps, int paramIndex, @Nullable String content) |
|
|
|
throws SQLException { |
|
|
|
throws SQLException { |
|
|
|
|
|
|
|
|
|
|
|
Clob clob = ps.getConnection().createClob(); |
|
|
|
if (content != null) { |
|
|
|
clob.setString(1, content); |
|
|
|
Clob clob = ps.getConnection().createClob(); |
|
|
|
|
|
|
|
clob.setString(1, content); |
|
|
|
this.temporaryClobs.add(clob); |
|
|
|
this.temporaryClobs.add(clob); |
|
|
|
ps.setClob(paramIndex, clob); |
|
|
|
ps.setClob(paramIndex, clob); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
ps.setClob(paramIndex, (Clob) null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
if (logger.isDebugEnabled()) { |
|
|
|
logger.debug(content != null ? "Copied string into temporary CLOB with length " + content.length() : |
|
|
|
logger.debug(content != null ? "Copied string into temporary CLOB with length " + content.length() : |
|
|
|
@ -183,4 +191,5 @@ public class TemporaryLobCreator implements LobCreator { |
|
|
|
logger.error("Could not free LOB", ex); |
|
|
|
logger.error("Could not free LOB", ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|