Package org.firebirdsql.jdbc.metadata
Class TypeMetadata
- java.lang.Object
- 
- org.firebirdsql.jdbc.metadata.TypeMetadata
 
- 
 public class TypeMetadata extends java.lang.ObjectHelper class to determine type metadata conforming to expectations ofDatabaseMetaData.- Since:
- 4.0
- Author:
- Mark Rotteveel
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTypeMetadata.Builderstatic classTypeMetadata.TypeBehaviour
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TypeMetadata.Builderbuilder(FirebirdSupportInfo supportInfo)Creates type metadata builder.java.lang.IntegergetCharOctetLength()java.lang.IntegergetColumnSize()Returns the column size (precision) of the type.static intgetDataType(int sqlType, int sqlSubType, int sqlScale, int characterSetId)Derives the JDBC data type fromTypesorJaybirdTypeCodesfrom metadata information.static java.lang.StringgetDataTypeName(int sqlType, int sqlSubType, int sqlScale)Derives the JDBC/SQL type name from metadata information.intgetJdbcType()java.lang.IntegergetLength()intgetRadix()java.lang.IntegergetScale()Returns the scale of the field.java.lang.StringgetSqlTypeName()
 
- 
- 
- 
Method Detail- 
getJdbcTypepublic int getJdbcType() - Returns:
- The TypesorJaybirdTypeCodescode for this datatype
 
 - 
getSqlTypeNamepublic java.lang.String getSqlTypeName() - Returns:
- The SQL datatype name, returns "NULL"if the type is unknown
 
 - 
getColumnSizepublic java.lang.Integer getColumnSize() Returns the column size (precision) of the type.The value returned follows the definition used in DatabaseMetaData, as established inDatabaseMetaData.getColumns(String, String, String, String)forCOLUMN_SIZE. The same definition is used for database metadata columnsPRECISIONin, among others,DatabaseMetaData.getFunctionColumns(String, String, String, String).This method will also return any non-zero precision information stored for other datatypes than those listed in the COLUMN_SIZEdefinition in the JDBC API.- Returns:
- The column size as defined in DatabaseMetaData, ornull.
 
 - 
getLengthpublic java.lang.Integer getLength() - Returns:
- The field length in bytes
 
 - 
getScalepublic java.lang.Integer getScale() Returns the scale of the field.For numerical types, returns a zero or positive scale. For types without scale, it returns null, for types that have a non-zero scale in the Firebird metadata, it returns the scale as stored.- Returns:
- The scale of a field, or null.
 
 - 
getRadixpublic int getRadix() - Returns:
- The radix of numerical precision (either 2or10; returns10for non-numerical, non-boolean types.
 
 - 
getCharOctetLengthpublic java.lang.Integer getCharOctetLength() - Returns:
- The maximum number of bytes for a character type column, nullotherwise
 
 - 
builderpublic static TypeMetadata.Builder builder(FirebirdSupportInfo supportInfo) Creates type metadata builder.- Parameters:
- supportInfo- Firebird support info
- Returns:
- Builder for type metadata
 
 - 
getDataTypepublic static int getDataType(int sqlType, int sqlSubType, int sqlScale, int characterSetId)Derives the JDBC data type fromTypesorJaybirdTypeCodesfrom metadata information.- Parameters:
- sqlType- Firebird type code as used in the metadata tables
- sqlSubType- Firebird sub-type code as used in the metadata tables
- sqlScale- Firebird scale as used in the metadata tables
- characterSetId- Character set id as used in the metadata tables
- Returns:
- JDBC data type code.
 
 - 
getDataTypeNamepublic static java.lang.String getDataTypeName(int sqlType, int sqlSubType, int sqlScale)Derives the JDBC/SQL type name from metadata information.- Parameters:
- sqlType- Firebird type code as used in the metadata tables
- sqlSubType- Firebird sub-type code as used in the metadata tables
- sqlScale- Firebird scale as used in the metadata tables
- Returns:
- JDBC/SQL type name
 
 
- 
 
-