org.firebirdsql.jdbc

## Class FBResultSetMetaData

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

- All Implemented Interfaces:
    java.sql.ResultSetMetaData, java.sql.Wrapper, FirebirdResultSetMetaData

      public class FBResultSetMetaData
      extends AbstractFieldMetaData
      implements FirebirdResultSetMetaData

  An object that can be used to get information about the types and properties of the columns in a `ResultSet` object.
  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 and Description
    --- | ---
    `protected` | `FBResultSetMetaData(RowDescriptor rowDescriptor, FBConnection connection)` Creates a new `FBResultSetMetaData` instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCatalogName(int column)`
    `java.lang.String` | `getColumnClassName(int column)`
    `int` | `getColumnCount()`
    `int` | `getColumnDisplaySize(int column)`
    `java.lang.String` | `getColumnLabel(int column)`
    `java.lang.String` | `getColumnName(int column)`
    `int` | `getColumnType(int column)`
    `java.lang.String` | `getColumnTypeName(int column)`
    `protected java.util.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)`
    `java.lang.String` | `getSchemaName(int column)`
    `java.lang.String` | `getTableAlias(int column)` Gets the designated column's table alias.
    `java.lang.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 Detail

    - #### FBResultSetMetaData

          protected FBResultSetMetaData(RowDescriptor rowDescriptor,
                                        FBConnection connection)
                                 throws java.sql.SQLException

      Creates a new `FBResultSetMetaData` instance.
      Parameters:
        `rowDescriptor` - a row descriptor
        `connection` - a `FBConnection` value
      Throws:
        `java.sql.SQLException` - if an error occurs

        TODO Need another constructor for metadata from constructed result set, where we supply the ext field info.

  - ### Method Detail

    - #### getColumnCount

          public int getColumnCount()
                             throws java.sql.SQLException

      Specified by:
        `getColumnCount` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isAutoIncrement

          public boolean isAutoIncrement(int column)
                                  throws java.sql.SQLException

      Specified by:
        `isAutoIncrement` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isCaseSensitive

          public boolean isCaseSensitive(int column)
                                  throws java.sql.SQLException

      The current implementation always returns `true`.

      Specified by:
        `isCaseSensitive` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isSearchable

          public boolean isSearchable(int column)
                               throws java.sql.SQLException

      Specified by:
        `isSearchable` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isCurrency

          public boolean isCurrency(int column)
                             throws java.sql.SQLException

      Specified by:
        `isCurrency` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isNullable

          public int isNullable(int column)
                         throws java.sql.SQLException

      Specified by:
        `isNullable` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isSigned

          public boolean isSigned(int column)
                           throws java.sql.SQLException

      Specified by:
        `isSigned` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getColumnDisplaySize

          public int getColumnDisplaySize(int column)
                                   throws java.sql.SQLException

      Specified by:
        `getColumnDisplaySize` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getColumnLabel

          public java.lang.String getColumnLabel(int column)
                                          throws java.sql.SQLException

      Specified by:
        `getColumnLabel` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getColumnName

          public java.lang.String getColumnName(int column)
                                         throws java.sql.SQLException

      Specified by:
        `getColumnName` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getSchemaName

          public java.lang.String getSchemaName(int column)
                                         throws java.sql.SQLException

      Specified by:
        `getSchemaName` in interface `java.sql.ResultSetMetaData`
      Returns:
        Always `""` as schemas are not supported.
      Throws:
        `java.sql.SQLException`

    - #### getPrecision

          public int getPrecision(int column)
                           throws java.sql.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 `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getScale

          public int getScale(int column)
                       throws java.sql.SQLException

      Specified by:
        `getScale` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getTableName

          public java.lang.String getTableName(int column)
                                        throws java.sql.SQLException

      Specified by:
        `getTableName` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getTableAlias

          public java.lang.String getTableAlias(int column)
                                         throws java.sql.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:
        `java.sql.SQLException` - if a database access error occurs

    - #### getCatalogName

          public java.lang.String getCatalogName(int column)
                                          throws java.sql.SQLException

      Specified by:
        `getCatalogName` in interface `java.sql.ResultSetMetaData`
      Returns:
        Always `""` as catalogs are not supported
      Throws:
        `java.sql.SQLException`

    - #### getColumnType

          public int getColumnType(int column)
                            throws java.sql.SQLException

      Specified by:
        `getColumnType` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getColumnTypeName

          public java.lang.String getColumnTypeName(int column)
                                             throws java.sql.SQLException

      Specified by:
        `getColumnTypeName` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isReadOnly

          public boolean isReadOnly(int column)
                             throws java.sql.SQLException

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

      Specified by:
        `isReadOnly` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isWritable

          public boolean isWritable(int column)
                             throws java.sql.SQLException

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

      Specified by:
        `isWritable` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### isDefinitelyWritable

          public boolean isDefinitelyWritable(int column)
                                       throws java.sql.SQLException

      Specified by:
        `isDefinitelyWritable` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getColumnClassName

          public java.lang.String getColumnClassName(int column)
                                              throws java.sql.SQLException

      Specified by:
        `getColumnClassName` in interface `java.sql.ResultSetMetaData`
      Throws:
        `java.sql.SQLException`

    - #### getExtendedFieldInfo

          protected java.util.Map<AbstractFieldMetaData.FieldKey,AbstractFieldMetaData.ExtendedFieldInfo> getExtendedFieldInfo(FBConnection connection)
                                                                                                                        throws java.sql.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:
        `java.sql.SQLException` - if a database error occurs while obtaining extended field information.

Copyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.