Java.Sql.IDatabaseMetaData.GetColumns Method
Returns a description of table columns available in a specified catalog.

Syntax

[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 IResultSet GetColumns (string catalog, string schemaPattern, string tableNamePattern, string columnNamePattern)

Parameters

catalog
a catalog name. null is used to imply no narrowing of the search by catalog name. Otherwise, the name must match a catalog name held in the database, with "" used to retrieve those without a catalog name.
schemaPattern
a schema name pattern. null is used to imply no narrowing of the search by schema name. Otherwise, the name must match a schema name in the database, with "" used to retrieve those without a schema name.
tableNamePattern
the table name. This must match the name of the table as declared in the database.
columnNamePattern
the column name. This must match the name of a column in the table in the database.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Sql.SQLExceptionif there is a database error.

Remarks

Returns a description of table columns available in a specified catalog. Only descriptions meeting the specified catalog, schema, table, and column names are returned.

The descriptions are returned as a ResultSet conforming to the following data layout, with one row per table column:

  1. TABLE_CAT - String - the catalog name (possibly null)
  2. TABLE_SCHEM - String - the schema name (possibly null)
  3. TABLE_NAME - String - the table name
  4. COLUMN_NAME - String - the column name
  5. DATA_TYPE - int - the SQL type as specified in java.sql.Types
  6. TYPE_NAME - String - the name of the data type, (database-dependent, UDT names are fully qualified)
  7. COLUMN_SIZE - int - the column size (the precision for numeric types, max characters for char and date types)
  8. BUFFER_LENGTH - int - Not used
  9. DECIMAL_DIGITS - int - maximum number of fractional digits
  10. NUM_PREC_RADIX - int - the radix for numerical types
  11. NULLABLE - int - whether the column allows nulls:
    • DatabaseMetaData.columnNoNulls = may not allow NULLs
    • DatabaseMetaData.columnNullable = does allow NULLs
    • DatabaseMetaData.columnNullableUnknown = unknown NULL status
    • REMARKS - String - A description of the column (possibly null)
    • COLUMN_DEF - String - Default value for the column (possibly null)
    • SQL_DATA_TYPE - int - not used
    • SQL_DATETIME_SUB - int - not used
    • CHAR_OCTET_LENGTH - int - maximum number of bytes in the char type columns
    • ORDINAL_POSITION - int - the column index in the table (1 based)
    • IS_NULLABLE - String - "NO" = column does not allow NULLs, "YES" = column allows NULLs, "" = NULL status unknown
    • SCOPE_CATALOG - String - if the DATA_TYPE is REF, this gives the catalog of the table corresponding to the attribute's scope. NULL if the DATA_TYPE is not REF.
    • SCOPE_SCHEMA - String - if the DATA_TYPE is REF, this gives the schema of the table corresponding to the attribute's scope. NULL if the DATA_TYPE is not REF.
    • SCOPE_TABLE - String - if the DATA_TYPE is REF, this gives the name of the table corresponding to the attribute's scope. NULL if the DATA_TYPE is not REF.
    • SOURCE_DATA_TYPE - String - The source type for a user generated REF type or for a Distinct type. (NULL if DATA_TYPE is not DISTINCT or a user generated REF)

    [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