Udostępnij za pośrednictwem


IDatabaseMetaData.GetColumns(String, String, String, String) Method

Definition

Retrieves a description of table columns available in the specified catalog.

[Android.Runtime.Register("getColumns", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetColumns_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? GetColumns (string? catalog, string? schemaPattern, string? tableNamePattern, string? columnNamePattern);
[<Android.Runtime.Register("getColumns", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;", "GetGetColumns_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 GetColumns : 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

tableNamePattern
String

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

columnNamePattern
String

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

Returns

ResultSet - each row is a column description

Attributes

Exceptions

if there is a database error.

Remarks

Retrieves a description of table columns available in the specified catalog.

Only column descriptions matching the catalog, schema, table and column name criteria are returned. They are ordered by TABLE_CAT,TABLE_SCHEM, TABLE_NAME, and ORDINAL_POSITION.

Each column description has the following columns: <OL> <LI><B>TABLE_CAT</B> String => table catalog (may be null) <LI><B>TABLE_SCHEM</B> String => table schema (may be null) <LI><B>TABLE_NAME</B> String => table name <LI><B>COLUMN_NAME</B> String => column name <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types <LI><B>TYPE_NAME</B> String => Data source dependent type name, for a UDT the type name is fully qualified <LI><B>COLUMN_SIZE</B> int => column size. <LI><B>BUFFER_LENGTH</B> is not used. <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 => is NULL allowed. <UL> <LI> columnNoNulls - might not allow NULL values <LI> columnNullable - definitely allows NULL values <LI> columnNullableUnknown - nullability unknown </UL> <LI><B>REMARKS</B> String => comment describing column (may be null) <LI><B>COLUMN_DEF</B> String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (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 column in table (starting at 1) <LI><B>IS_NULLABLE</B> String => ISO rules are used to determine the nullability for a column. <UL> <LI> YES --- if the column can include NULLs <LI> NO --- if the column cannot include NULLs <LI> empty string --- if the nullability for the column 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 the DATA_TYPE isn't REF) <LI><B>SCOPE_TABLE</B> String => table name that this 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) <LI><B>IS_AUTOINCREMENT</B> String => Indicates whether this column is auto incremented <UL> <LI> YES --- if the column is auto incremented <LI> NO --- if the column is not auto incremented <LI> empty string --- if it cannot be determined whether the column is auto incremented </UL> <LI><B>IS_GENERATEDCOLUMN</B> String => Indicates whether this is a generated column <UL> <LI> YES --- if this a generated column <LI> NO --- if this not a generated column <LI> empty string --- if it cannot be determined whether this is a generated column </UL> </OL>

The COLUMN_SIZE column specifies the column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable.

Java documentation for java.sql.DatabaseMetaData.getColumns(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