@Override public void setBlobAsBinaryStream(PreparedStatement ps, int paramIndex, InputStream contentStream, int contentLength) throws SQLException { ps.setBlob(paramIndex, contentStream, contentLength); }
@Override public void setBlobAsBytes(PreparedStatement ps, int paramIndex, @Nullable byte[] content) throws SQLException { if (streamAsLob) { if (content != null) { ps.setBlob(paramIndex, new ByteArrayInputStream(content), content.length); } else { ps.setBlob(paramIndex, (Blob) null); } } else if (wrapAsLob) { if (content != null) { ps.setBlob(paramIndex, new PassThroughBlob(content)); } else { ps.setBlob(paramIndex, (Blob) null); } } else { ps.setBytes(paramIndex, content); } if (logger.isDebugEnabled()) { logger.debug(content != null ? "Set bytes for BLOB with length " + content.length : "Set BLOB to null"); } }
@Override public void setBlobAsBytes(PreparedStatement ps, int paramIndex, @Nullable byte[] content) throws SQLException { if (content != null) { Blob blob = ps.getConnection().createBlob(); blob.setBytes(1, content); this.temporaryBlobs.add(blob); ps.setBlob(paramIndex, blob); } else { ps.setBlob(paramIndex, (Blob) null); } if (logger.isDebugEnabled()) { logger.debug(content != null ? "Copied bytes into temporary BLOB with length " + content.length : "Set BLOB to null"); } }
@Override public final void setBlob(final int parameterIndex, final Blob x) throws SQLException { getTargetPreparedStatement().setBlob(parameterIndex, x); }
@Override public final void setBlob(final int parameterIndex, final InputStream x) throws SQLException { getTargetPreparedStatement().setBlob(parameterIndex, x); }
@Override public final void setBlob(final int parameterIndex, final InputStream x, final long length) throws SQLException { getTargetPreparedStatement().setBlob(parameterIndex, x, length); }
@Override public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { setParamByIndex(parameterIndex, inputStream); targetStatement.setBlob(parameterIndex, inputStream); }
@Override public void setBlob(int parameterIndex, Blob x) throws SQLException { setParamByIndex(parameterIndex, x); targetStatement.setBlob(parameterIndex, x); }
@Override public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { setParamByIndex(parameterIndex, inputStream); targetStatement.setBlob(parameterIndex, inputStream, length); }
@Override public void setBlobAsBytes(PreparedStatement ps, int paramIndex, byte[] content) throws SQLException { Blob blob = ps.getConnection().createBlob(); blob.setBytes(1, content); ps.setBlob(paramIndex, blob); }
@Override public void setBlobAsBinaryStream( PreparedStatement ps, int paramIndex, @Nullable InputStream binaryStream, int contentLength) throws SQLException { if (binaryStream != null) { Blob blob = ps.getConnection().createBlob(); try { FileCopyUtils.copy(binaryStream, blob.setBinaryStream(1)); } catch (IOException ex) { throw new DataAccessResourceFailureException("Could not copy into LOB stream", ex); } this.temporaryBlobs.add(blob); ps.setBlob(paramIndex, blob); } else { ps.setBlob(paramIndex, (Blob) null); } if (logger.isDebugEnabled()) { logger.debug(binaryStream != null ? "Copied binary stream into temporary BLOB with length " + contentLength : "Set BLOB to null"); } }
@Override public void setBlob(int parameterIndex, Blob x) throws SQLException { checkOpen(); try { stmt.setBlob(parameterIndex, x); } catch (Throwable t) { throw checkException(t); } }
@Override public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { checkOpen(); try { stmt.setBlob(parameterIndex, inputStream, length); } catch (Throwable t) { throw checkException(t); } }
@Override public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { checkOpen(); try { stmt.setBlob(parameterIndex, inputStream); } catch (Throwable t) { throw checkException(t); } }
@Override public void preparedStatement_setBlob(PreparedStatementProxy statement, int parameterIndex, Blob x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBlob(this, statement, parameterIndex, x); return; } statement.getRawObject() .setBlob(parameterIndex, x); }
@Override public void preparedStatement_setBlob(PreparedStatementProxy statement, int parameterIndex, InputStream inputStream) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBlob(this, statement, parameterIndex, inputStream); return; } statement.getRawObject().setBlob(parameterIndex, inputStream); }
@Override public void preparedStatement_setBlob(PreparedStatementProxy statement, int parameterIndex, InputStream inputStream, long length) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setBlob(this, statement, parameterIndex, inputStream, length); return; } statement.getRawObject().setBlob(parameterIndex, inputStream, length); }
public Q setBlob(final int index, final Blob value) { initPrepared(); try { preparedStatement.setBlob(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); }
public Q setBlob(final String param, final Blob value) { initPrepared(); final int[] positions = query.getNamedParameterIndices(param); try { for (final int position : positions) { preparedStatement.setBlob(position, value); } } catch (SQLException sex) { throwSetParamError(param, sex); } return _this(); }