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

Syntax

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

Parameters

parameterIndex
the parameter number index, where the first parameter has index 1.
theObject
the object containing the value to which the parameter at parameterIndex is set.

Exceptions

TypeReason
Java.Sql.SQLExceptionif a database error happens.

Remarks

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

There is a standard mapping from Java types to SQL types, defined in the JDBC specification. The passed object is then transformed into the appropriate SQL type, and then transferred to the database. setObject can be used to pass abstract data types unique to the database, by using a JDBC driver specific Java type. If the object's class implements the interface SQLData, the JDBC driver calls SQLData.writeSQL to write it to the SQL data stream. If the object's class implements Ref, Blob, Clob, Struct, or Array, the driver passes it to the database as a value of the corresponding 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