Udostępnij za pośrednictwem


IDatabaseMetaData.GetAttributes(String, String, String, String) Method

Definition

Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog.

[Android.Runtime.Register("getAttributes", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetAttributes_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler:Java.Sql.IDatabaseMetaDataInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public Java.Sql.IResultSet? GetAttributes (string? catalog, string? schemaPattern, string? typeNamePattern, string? attributeNamePattern);
[<Android.Runtime.Register("getAttributes", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetAttributes_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Ljava_lang_String_Handler:Java.Sql.IDatabaseMetaDataInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetAttributes : string * string * string * string -> Java.Sql.IResultSet

Parameters

catalog
String

a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search

schemaPattern
String

a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search

typeNamePattern
String

a type name pattern; must match the type name as it is stored in the database

attributeNamePattern
String

an attribute name pattern; must match the attribute name as it is declared in the database

Returns

a ResultSet object in which each row is an attribute description

Attributes

Exceptions

if there is a database error.

Remarks

Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog.

Descriptions are returned only for attributes of UDTs matching the catalog, schema, type, and attribute name criteria. They are ordered by TYPE_CAT, TYPE_SCHEM, TYPE_NAME and ORDINAL_POSITION. This description does not contain inherited attributes.

The ResultSet object that is returned has the following columns: <OL> <LI><B>TYPE_CAT</B> String => type catalog (may be null) <LI><B>TYPE_SCHEM</B> String => type schema (may be null) <LI><B>TYPE_NAME</B> String => type name <LI><B>ATTR_NAME</B> String => attribute name <LI><B>DATA_TYPE</B> int => attribute type SQL type from java.sql.Types <LI><B>ATTR_TYPE_NAME</B> String => Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified and represents the target type of the reference type. <LI><B>ATTR_SIZE</B> int => column size. For char or date types this is the maximum number of characters; for numeric or decimal types this is precision. <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits. Null is returned for data types where DECIMAL_DIGITS is not applicable. <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2) <LI><B>NULLABLE</B> int => whether NULL is allowed <UL> <LI> attributeNoNulls - might not allow NULL values <LI> attributeNullable - definitely allows NULL values <LI> attributeNullableUnknown - nullability unknown </UL> <LI><B>REMARKS</B> String => comment describing column (may be null) <LI><B>ATTR_DEF</B> String => default value (may be null) <LI><B>SQL_DATA_TYPE</B> int => unused <LI><B>SQL_DATETIME_SUB</B> int => unused <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the maximum number of bytes in the column <LI><B>ORDINAL_POSITION</B> int => index of the attribute in the UDT (starting at 1) <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine the nullability for a attribute. <UL> <LI> YES --- if the attribute can include NULLs <LI> NO --- if the attribute cannot include NULLs <LI> empty string --- if the nullability for the attribute is unknown </UL> <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF) <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF) <LI><B>SCOPE_TABLE</B> String => table name that is the scope of a reference attribute (null if the DATA_TYPE isn't REF) <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or user-generated Ref type,SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF) </OL>

Added in 1.4.

Java documentation for java.sql.DatabaseMetaData.getAttributes(java.lang.String, java.lang.String, java.lang.String, java.lang.String).

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