setBytes(long pos, byte[] bytes, int offset, int len)


int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException


Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written. The array of bytes will overwrite the existing bytes in the Blob object starting at the position pos. If the end of the Blob value is reached while writing the array of bytes, then the length of the Blob value will be increased to accommodate the extra bytes.



the position in the BLOB object at which to start writing; the first position is 1


the array of bytes to be written to this BLOB object


the offset into the array bytes at which to start reading the bytes to be set


the number of bytes to be written to the BLOB value from the array of bytes bytes


the number of bytes written


SQLException - if a database access error occurs, pos < 1, bytes is null, offset < 0, len < 0 or offset + len > bytes.length


For more information, reference JDBC documentation for: Blob.setBytes(long, byte[], int, int)