共用方式為


IPreparedStatement.SetBlob Method

Definition

Overloads

SetBlob(Int32, IBlob)

Sets the designated parameter to the given java.sql.Blob object.

SetBlob(Int32, Stream)

Sets the designated parameter to a InputStream object.

SetBlob(Int32, Stream, Int64)

Sets the designated parameter to a InputStream object.

SetBlob(Int32, IBlob)

Sets the designated parameter to the given java.sql.Blob object.

[Android.Runtime.Register("setBlob", "(ILjava/sql/Blob;)V", "GetSetBlob_ILjava_sql_Blob_Handler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetBlob (int parameterIndex, Java.Sql.IBlob? x);
[<Android.Runtime.Register("setBlob", "(ILjava/sql/Blob;)V", "GetSetBlob_ILjava_sql_Blob_Handler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetBlob : int * Java.Sql.IBlob -> unit

Parameters

parameterIndex
Int32

the first parameter is 1, the second is 2, ...

x
IBlob

a Blob object that maps an SQL BLOB value

Attributes

Exceptions

if a database error happens.

Remarks

Sets the designated parameter to the given java.sql.Blob object. The driver converts this to an SQL BLOB value when it sends it to the database.

Added in 1.2.

Java documentation for java.sql.PreparedStatement.setBlob(int, java.sql.Blob).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to

SetBlob(Int32, Stream)

Sets the designated parameter to a InputStream object.

[Android.Runtime.Register("setBlob", "(ILjava/io/InputStream;)V", "GetSetBlob_ILjava_io_InputStream_Handler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetBlob (int parameterIndex, System.IO.Stream? inputStream);
[<Android.Runtime.Register("setBlob", "(ILjava/io/InputStream;)V", "GetSetBlob_ILjava_io_InputStream_Handler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetBlob : int * System.IO.Stream -> unit

Parameters

parameterIndex
Int32

index of the first parameter is 1, the second is 2, ...

inputStream
Stream

An object that contains the data to set the parameter value to.

Attributes

Exceptions

if a database error happens.

Remarks

Sets the designated parameter to a InputStream object. This method differs from the setBinaryStream (int, InputStream) method because it informs the driver that the parameter value should be sent to the server as a BLOB. When the setBinaryStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the server as a LONGVARBINARY or a BLOB

<B>Note:</B> Consult your JDBC driver documentation to determine if it might be more efficient to use a version of setBlob which takes a length parameter.

Added in 1.6.

Java documentation for java.sql.PreparedStatement.setBlob(int, java.io.InputStream).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetBlob(Int32, Stream, Int64)

Sets the designated parameter to a InputStream object.

[Android.Runtime.Register("setBlob", "(ILjava/io/InputStream;J)V", "GetSetBlob_ILjava_io_InputStream_JHandler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetBlob (int parameterIndex, System.IO.Stream? inputStream, long length);
[<Android.Runtime.Register("setBlob", "(ILjava/io/InputStream;J)V", "GetSetBlob_ILjava_io_InputStream_JHandler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member SetBlob : int * System.IO.Stream * int64 -> unit

Parameters

parameterIndex
Int32

index of the first parameter is 1, the second is 2, ...

inputStream
Stream

An object that contains the data to set the parameter value to.

length
Int64

the number of bytes in the parameter data.

Attributes

Exceptions

if a database error happens.

Remarks

Sets the designated parameter to a InputStream object. The inputstream must contain the number of characters specified by length otherwise a SQLException will be generated when the PreparedStatement is executed. This method differs from the setBinaryStream (int, InputStream, int) method because it informs the driver that the parameter value should be sent to the server as a BLOB. When the setBinaryStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the server as a LONGVARBINARY or a BLOB

Added in 1.6.

Java documentation for java.sql.PreparedStatement.setBlob(int, java.io.InputStream, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to