Class JDBCTypeDescription


  • public class JDBCTypeDescription
    extends Object
    This class implements a parameter object describing attributes of a JDBC data type.

    The size of a type can differ from the octet length of that type if the data type uses multiple bytes to represent a character. This is for example the case for UTF encoding.

    The original name helps distinguishing types that have the same identifier number but different meaning.

    • Constructor Detail

      • JDBCTypeDescription

        public JDBCTypeDescription​(int jdbcType,
                                   int decimalScale,
                                   int precisionOrSize,
                                   int byteSize,
                                   String typeName)
        Create a new instance of a JDBC data type.
        Parameters:
        jdbcType - type identifier as presented by the JDBC driver of the database
        decimalScale - number of digits behind the point
        precisionOrSize - precision for numbers or size for size types (like VARCHAR)
        byteSize - storage size the data type needs in bytes
        typeName - original name the type has in the database
    • Method Detail

      • getJdbcType

        public int getJdbcType()
        Get the JDBC type identifier.
        Returns:
        type identifier as number
      • getDecimalScale

        public int getDecimalScale()
        Get the decimal scale.
        Returns:
        decimal scale
      • getPrecisionOrSize

        public int getPrecisionOrSize()
        Get the precision for numeric types or size for size types (like VARCHAR).
        Returns:
        precision or size
      • getByteSize

        public int getByteSize()
        Storage size in eight-bit bytes (aka. octets).
        Returns:
        size in bytes
      • getTypeName

        public String getTypeName()
        Get the original name of the data type.
        Returns:
        original type name