java.lang.Object
org.firebirdsql.jdbc.field.JdbcTypeConverter
Helper class to convert from Firebird and metadata type information to JDBC type information.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic intfromFirebirdToJdbcType(int firebirdType, int subtype, int scale) Converts from the Firebird type, subtype and scale to the JDBC type value fromTypes.static intfromMetaDataToFirebirdType(int metaDataType) Converts the metadata type value to the Firebird type value (null bit not set).static intfromMetaDataToJdbcType(int metaDataType, int subtype, int scale) Converts from the metadata type (as used in the system tables) to JDBC type values fromTypes.static StringgetTypeName(int jdbcType, int firebirdType, int subtype, int scale) static booleanisJdbcType(FieldDescriptor fieldDescriptor, int jdbcType) Determines if a field descriptor matches a JDBC type value fromTypes.static inttoJdbcType(FieldDescriptor fieldDescriptor) Gets the JDBC type value fromTypesfor the field descriptor.
-
Method Details
-
toJdbcType
Gets the JDBC type value fromTypesfor the field descriptor.- Parameters:
fieldDescriptor- Field descriptor- Returns:
- JDBC type, or
Types.OTHERfor unknown types
-
isJdbcType
Determines if a field descriptor matches a JDBC type value fromTypes.- Parameters:
fieldDescriptor- Field descritporjdbcType- JDBC type- Returns:
trueif the field descriptor and JDBC type are equivalent (usingtoJdbcType(FieldDescriptor))
-
fromFirebirdToJdbcType
public static int fromFirebirdToJdbcType(int firebirdType, int subtype, int scale) Converts from the Firebird type, subtype and scale to the JDBC type value fromTypes.This method is not capable of identifying
Types.ROWID; this will be identified asTypes.BINARYinstead.- Parameters:
firebirdType- Firebird type value (fromISCConstantsSQL_*with or without nullable bit setsubtype- Subtypescale- Scale- Returns:
- JDBC type, or
Types.OTHERfor 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 fromTypes.- Parameters:
metaDataType- Metadata type valuesubtype- Subtypescale- Scale- Returns:
- JDBC type, or
Types.OTHERfor 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
-
getTypeName
-