Writes the given array of bytes into the BLOB starting at the given position, and then returns the number of bytes written.

语法

public int setBytes(long pos,
                    byte[] bytes)

参数

pos

The position (1-based) in the BLOB at which to start writing the data.

bytes

The array of bytes to be written into the BLOB.

返回值

A long value that specifies the number of bytes written.

异常

java.sql.SQLException

备注

This setBytes method is specified by the setBytes method in the java.sql.Blob interface.

Data is overwritten starting at the specified position and can overrun the initial length of the BLOB. Specifying a position+1 values will append bytes. Passing a position+2 or greater (or zero or less) value will cause a position error to be thrown. Passing a zero-length byte array will return zero because no bytes were written.

另请参见

SQLServerBlob Class
setBytes Method (SQLServerBlob)
SQLServerBlob Methods
SQLServerBlob Members