Module org.firebirdsql.jaybird
Package org.firebirdsql.jdbc

# Class FBResultSetMetaData

java.lang.Object
org.firebirdsql.jdbc.AbstractFieldMetaData
org.firebirdsql.jdbc.FBResultSetMetaData

All Implemented Interfaces:
  `ResultSetMetaData`, `Wrapper`, `FirebirdResultSetMetaData`

@InternalApi public class FBResultSetMetaData extends AbstractFieldMetaData implements FirebirdResultSetMetaData
Information about the types and properties of the columns in a `ResultSet` object.

This class is internal API of Jaybird. Future versions may radically change, move, or make inaccessible this type. For the public API, refer to the `ResultSetMetaData` and `FirebirdResultSetMetaData` interfaces.

Author:
  David Jencks, Mark Rotteveel

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.firebirdsql.jdbc.AbstractFieldMetaData

  `AbstractFieldMetaData.ExtendedFieldInfo, AbstractFieldMetaData.FieldKey`

- ## Field Summary

  ### Fields inherited from interface java.sql.ResultSetMetaData

  `columnNoNulls, columnNullable, columnNullableUnknown`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `FBResultSetMetaData(RowDescriptor rowDescriptor, FBConnection connection)`
  Creates a new `FBResultSetMetaData` instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getCatalogName(int column)`
  `String`
  `getColumnClassName(int column)`
  `int`
  `getColumnCount()`
  `int`
  `getColumnDisplaySize(int column)`
  `String`
  `getColumnLabel(int column)`
  `String`
  `getColumnName(int column)`
  `int`
  `getColumnType(int column)`
  `String`
  `getColumnTypeName(int column)`
  `protected Map<AbstractFieldMetaData.FieldKey,AbstractFieldMetaData.ExtendedFieldInfo>`
  `getExtendedFieldInfo(FBConnection connection)`
  This method retrieves extended information from the system tables in a database.
  `int`
  `getPrecision(int column)`
  `int`
  `getScale(int column)`
  `String`
  `getSchemaName(int column)`
  `String`
  `getTableAlias(int column)`
  Gets the designated column's table alias.
  `String`
  `getTableName(int column)`
  `boolean`
  `isAutoIncrement(int column)`
  `boolean`
  `isCaseSensitive(int column)`
  `boolean`
  `isCurrency(int column)`
  `boolean`
  `isDefinitelyWritable(int column)`
  `int`
  `isNullable(int column)`
  `boolean`
  `isReadOnly(int column)`
  `boolean`
  `isSearchable(int column)`
  `boolean`
  `isSigned(int column)`
  `boolean`
  `isWritable(int column)`

  ### Methods inherited from class org.firebirdsql.jdbc.AbstractFieldMetaData

  `estimateFixedPrecision, getExtFieldInfo, getFieldClassName, getFieldCount, getFieldDescriptor, getFieldType, getFieldTypeName, getPrecisionInternal, getRowDescriptor, getScaleInternal, isSignedInternal, isWrapperFor, unwrap`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.sql.Wrapper

  `isWrapperFor, unwrap`

- ## Constructor Details

  - ### FBResultSetMetaData

    protected FBResultSetMetaData(RowDescriptor rowDescriptor, FBConnection connection) throws SQLException
    Creates a new `FBResultSetMetaData` instance.
    Parameters:
      `rowDescriptor` - a row descriptor
      `connection` - a `FBConnection` value
    Throws:
      `SQLException` - if an error occurs

- ## Method Details

  - ### getColumnCount

    public int getColumnCount() throws SQLException
    Specified by:
      `getColumnCount` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isAutoIncrement

    public boolean isAutoIncrement(int column) throws SQLException
    Specified by:
      `isAutoIncrement` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isCaseSensitive

    public boolean isCaseSensitive(int column) throws SQLException

    The current implementation always returns `true`.

    Specified by:
      `isCaseSensitive` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isSearchable

    public boolean isSearchable(int column) throws SQLException
    Specified by:
      `isSearchable` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isCurrency

    public boolean isCurrency(int column) throws SQLException
    Specified by:
      `isCurrency` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isNullable

    public int isNullable(int column) throws SQLException
    Specified by:
      `isNullable` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isSigned

    public boolean isSigned(int column) throws SQLException
    Specified by:
      `isSigned` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getColumnDisplaySize

    public int getColumnDisplaySize(int column) throws SQLException
    Specified by:
      `getColumnDisplaySize` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getColumnLabel

    public String getColumnLabel(int column) throws SQLException
    Specified by:
      `getColumnLabel` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getColumnName

    public String getColumnName(int column) throws SQLException
    Specified by:
      `getColumnName` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getSchemaName

    public String getSchemaName(int column) throws SQLException
    Specified by:
      `getSchemaName` in interface `ResultSetMetaData`
    Returns:
      Always `""` as schemas are not supported.
    Throws:
      `SQLException`

  - ### getPrecision

    public int getPrecision(int column) throws SQLException

    NOTE For `NUMERIC` and `DECIMAL` we attempt to retrieve the exact precision from the metadata, if this is not possible (eg the column is dynamically defined in the query), the reported precision is the maximum precision allowed by the underlying storage data type.

    Specified by:
      `getPrecision` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getScale

    public int getScale(int column) throws SQLException
    Specified by:
      `getScale` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getTableName

    public String getTableName(int column) throws SQLException
    Specified by:
      `getTableName` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getTableAlias

    public String getTableAlias(int column) throws SQLException
    Description copied from interface: `FirebirdResultSetMetaData`
    Gets the designated column's table alias.
    Specified by:
      `getTableAlias` in interface `FirebirdResultSetMetaData`
    Parameters:
      `column` - the first column is 1, the second is 2, ...
    Returns:
      table alias or "" if not applicable
    Throws:
      `SQLException` - if a database access error occurs

  - ### getCatalogName

    public String getCatalogName(int column) throws SQLException
    Specified by:
      `getCatalogName` in interface `ResultSetMetaData`
    Returns:
      Always `""` as catalogs are not supported
    Throws:
      `SQLException`

  - ### getColumnType

    public int getColumnType(int column) throws SQLException
    Specified by:
      `getColumnType` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getColumnTypeName

    public String getColumnTypeName(int column) throws SQLException
    Specified by:
      `getColumnTypeName` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isReadOnly

    public boolean isReadOnly(int column) throws SQLException

    The current implementation always returns `false`, except for a DB_KEY column.

    Specified by:
      `isReadOnly` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isWritable

    public boolean isWritable(int column) throws SQLException

    The current implementation always returns `true`, except for a DB_KEY column.

    Specified by:
      `isWritable` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### isDefinitelyWritable

    public boolean isDefinitelyWritable(int column) throws SQLException
    Specified by:
      `isDefinitelyWritable` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getColumnClassName

    public String getColumnClassName(int column) throws SQLException
    Specified by:
      `getColumnClassName` in interface `ResultSetMetaData`
    Throws:
      `SQLException`

  - ### getExtendedFieldInfo

    protected Map<AbstractFieldMetaData.FieldKey,AbstractFieldMetaData.ExtendedFieldInfo> getExtendedFieldInfo(FBConnection connection) throws SQLException
    Description copied from class: `AbstractFieldMetaData`
    This method retrieves extended information from the system tables in a database. Since this method is expensive, use it with care.
    Specified by:
      `getExtendedFieldInfo` in class `AbstractFieldMetaData`
    Returns:
      mapping between `AbstractFieldMetaData.FieldKey` instances and `AbstractFieldMetaData.ExtendedFieldInfo` instances, or an empty Map if the metadata implementation does not support extended info.
    Throws:
      `SQLException` - if a database error occurs while obtaining extended field information.