setBytes(long pos, byte[] bytes)

Syntax:

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

Description:

Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes 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.

Parameters:

pos

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

bytes

the array of bytes to be written to the BLOB value that this Blob object represents

Returns:

the number of bytes written

Throws:

SQLException - if a database access error occurs or pos < 1 or if bytes is null

References:

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