org.firebirdsql.jdbc.field

## Class JdbcTypeConverter

- java.lang.Object
- - org.firebirdsql.jdbc.field.JdbcTypeConverter

-     public final class JdbcTypeConverter
      extends java.lang.Object

  Helper class to convert from Firebird and metadata type information to JDBC type information.
  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `fromFirebirdToJdbcType(int firebirdType, int subtype, int scale)` Converts from the Firebird type, subtype and scale to the JDBC type value from `Types`.
    `static int` | `fromMetaDataToFirebirdType(int metaDataType)` Converts the metadata type value to the Firebird type value (null bit not set).
    `static int` | `fromMetaDataToJdbcType(int metaDataType, int subtype, int scale)` Converts from the metadata type (as used in the system tables) to JDBC type values from `Types`.
    `static int` | `toJdbcType(FieldDescriptor fieldDescriptor)` Gets the JDBC type value from `Types` for the field descriptor.

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

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

- - ### Method Detail

    - #### toJdbcType

          public static int toJdbcType(FieldDescriptor fieldDescriptor)

      Gets the JDBC type value from `Types` for the field descriptor.
      Parameters:
        `fieldDescriptor` - Field descriptor
      Returns:
        JDBC type, or `Types.OTHER` for unknown types

    - #### fromFirebirdToJdbcType

          public static int fromFirebirdToJdbcType(int firebirdType,
                                   int subtype,
                                   int scale)

      Converts from the Firebird type, subtype and scale to the JDBC type value from `Types`.
      Parameters:
        `firebirdType` - Firebird type value (from `ISCConstants` `SQL_*` with or without nullable bit set
        `subtype` - Subtype
        `scale` - Scale
      Returns:
        JDBC type, or `Types.OTHER` for unknown types

    - #### fromMetaDataToJdbcType

          public static int fromMetaDataToJdbcType(int metaDataType,
                                   int subtype,
                                   int scale)

      Converts from the metadata type (as used in the system tables) to JDBC type values from `Types`.
      Parameters:
        `metaDataType` - Metadata type value
        `subtype` - Subtype
        `scale` - Scale
      Returns:
        JDBC type, or `Types.OTHER` for unknown types

    - #### fromMetaDataToFirebirdType

          public static int fromMetaDataToFirebirdType(int metaDataType)

      Converts the metadata type value to the Firebird type value (null bit not set).
      Parameters:
        `metaDataType` - Metadata type value
      Returns:
        Firebird type value

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.