Package org.firebirdsql.jdbc.field
Class JdbcTypeConverter
- java.lang.Object
-
- org.firebirdsql.jdbc.field.JdbcTypeConverter
-
@InternalApi 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 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 Detail
-
toJdbcType
public static int toJdbcType(FieldDescriptor fieldDescriptor)
Gets the JDBC type value fromTypesfor the field descriptor.- Parameters:
fieldDescriptor- Field descriptor- Returns:
- JDBC type, or
Types.OTHERfor unknown types
-
isJdbcType
public static boolean isJdbcType(FieldDescriptor fieldDescriptor, int jdbcType)
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
-
-