Udostępnij za pośrednictwem


IConnection.CreateArrayOf(String, Object[]) Method

Definition

Factory method for creating Array objects.

[Android.Runtime.Register("createArrayOf", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;", "GetCreateArrayOf_Ljava_lang_String_arrayLjava_lang_Object_Handler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IArray? CreateArrayOf (string? typeName, Java.Lang.Object[]? elements);
[<Android.Runtime.Register("createArrayOf", "(Ljava/lang/String;[Ljava/lang/Object;)Ljava/sql/Array;", "GetCreateArrayOf_Ljava_lang_String_arrayLjava_lang_Object_Handler:Java.Sql.IConnectionInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member CreateArrayOf : string * Java.Lang.Object[] -> Java.Sql.IArray

Parameters

typeName
String

the SQL name of the type the elements of the array map to. The typeName is a database-specific name which may be the name of a built-in type, a user-defined type or a standard SQL type supported by this database. This is the value returned by Array.getBaseTypeName

elements
Object[]

the elements that populate the returned object

Returns

an Array object whose elements map to the specified SQL type

Attributes

Exceptions

if this connection is closed, or there's a problem creating the array.

Remarks

Factory method for creating Array objects.

<b>Note: </b>When createArrayOf is used to create an array object that maps to a primitive data type, then it is implementation-defined whether the Array object is an array of that primitive data type or an array of Object.

<b>Note: </b>The JDBC driver is responsible for mapping the elements Object array to the default JDBC SQL type defined in java.sql.Types for the given class of Object. The default mapping is specified in Appendix B of the JDBC specification. If the resulting JDBC type is not the appropriate type for the given typeName then it is implementation defined whether an SQLException is thrown or the driver supports the resulting conversion.

Added in 1.6.

Java documentation for java.sql.Connection.createArrayOf(java.lang.String, java.lang.Object[]).

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