Interface ColumnMetadata


public interface ColumnMetadata
Interface that provides methods for accessing column metadata.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Represents a column origin.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Value precision() returns when precision is not applicable to the column's type.
    static final int
    Value scale() returns when scale is not applicable to the column's type.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a column name in the result set.
    boolean
    Returns a row column nullability flag.
    Returns a column origin.
    int
    Returns an SQL column precision, or UNDEFINED_PRECISION if precision is not applicable to the column's type.
    int
    Returns an SQL column scale, or UNDEFINED_SCALE if scale is not applicable to the column's type.
    Returns an SQL column type.
    Returns a class of column values.
  • Field Details

  • Method Details

    • name

      String name()
      Returns a column name in the result set.

      Note: If a row column does not represent any table column, a generated name is used.

      Returns:
      Column name.
    • valueClass

      Class<?> valueClass()
      Returns a class of column values.
      Returns:
      Value class.
    • type

      ColumnType type()
      Returns an SQL column type.
      Returns:
      Value type.
    • precision

      int precision()
      Returns an SQL column precision, or UNDEFINED_PRECISION if precision is not applicable to the column's type.
      Returns:
      Number of decimal digits for exact numeric types; number of decimal digits in mantissa for approximate numeric types; number of decimal digits for fractional seconds of datetime types; length in characters for character types; length in bytes for binary types; length in bits for bit types; 1 for BOOLEAN; UNDEFINED_PRECISION if precision is not valid for the type.
    • scale

      int scale()
      Returns an SQL column scale, or UNDEFINED_SCALE if scale is not applicable to the column's type.

      Note that the two undefined markers differ in value: UNDEFINED_SCALE is Integer.MIN_VALUE while UNDEFINED_PRECISION is -1.

      Returns:
      Number of digits of scale, or UNDEFINED_SCALE if scale is not applicable to the column's type.
    • nullable

      boolean nullable()
      Returns a row column nullability flag.
      Returns:
      true if column is nullable, false otherwise.
    • origin

      @Nullable @Nullable ColumnMetadata.ColumnOrigin origin()
      Returns a column origin.
      Returns:
      Column origin or null if not applicable.