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 int
fromFirebirdToJdbcType(int firebirdType, int subtype, int scale)
Converts from the Firebird type, subtype and scale to the JDBC type value fromTypes
.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 fromTypes
.static boolean
isJdbcType(FieldDescriptor fieldDescriptor, int jdbcType)
Determines if a field descriptor matches a JDBC type value fromTypes
.static int
toJdbcType(FieldDescriptor fieldDescriptor)
Gets the JDBC type value fromTypes
for the field descriptor.
-
-
-
Method Detail
-
toJdbcType
public static int toJdbcType(FieldDescriptor fieldDescriptor)
Gets the JDBC type value fromTypes
for the field descriptor.- Parameters:
fieldDescriptor
- Field descriptor- Returns:
- JDBC type, or
Types.OTHER
for 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:
true
if 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.BINARY
instead.- Parameters:
firebirdType
- Firebird type value (fromISCConstants
SQL_*
with or without nullable bit setsubtype
- Subtypescale
- 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 fromTypes
.- Parameters:
metaDataType
- Metadata type valuesubtype
- Subtypescale
- 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
-
-