Java.Sql.IPreparedStatement.SetObject Method
Sets the value of a specified parameter using a supplied object.

Syntax

[Android.Runtime.Register("setObject", "(ILjava/lang/Object;II)V", "GetSetObject_ILjava_lang_Object_IIHandler:Java.Sql.IPreparedStatementInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void SetObject (int parameterIndex, Java.Lang.Object theObject, int targetSqlType, int scale)

Parameters

parameterIndex
the parameter index, where the first parameter has index 1.
theObject
the Object containing the value to which the parameter at parameterIndex is set.
targetSqlType
the SQL type to send to the database, as defined in java.sql.Types.
scale
the number of digits after the decimal point - only applies to the types java.sql.Types.DECIMAL and java.sql.Types.NUMERIC - ignored for all other types.

Exceptions

TypeReason
Java.Sql.SQLExceptionif a database error happens.

Remarks

Sets the value of a specified parameter using a supplied object.

The object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver will call the method SQLData.writeSQL to write it to the SQL data stream. If the object's class implements Ref, Blob, Clob, Struct, or Array, the driver will pass it to the database in the form of the relevant SQL type.

[Android Documentation]

Requirements

Namespace: Java.Sql
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1