Class JDBCSQLTypeInfo


  • public final class JDBCSQLTypeInfo
    extends Object

    This is a helper class used to obtain SQL type information for java types. The SQL type information is obtained from java.sql.Types class. The integers and strings returned by methods in this class are based on constants in java.sql.Types.

    • Field Detail

      • DEFAULT_RADIX

        public static final Integer DEFAULT_RADIX
      • DEFAULT_SCALE

        public static final Integer DEFAULT_SCALE
      • XML_COLUMN_LENGTH

        public static final Integer XML_COLUMN_LENGTH
    • Method Detail

      • getSQLType

        public static final int getSQLType​(String typeName)
        This method is used to obtain a short indicating JDBC SQL type for any object. The short values that give the type info are from java.sql.Types.
        Parameters:
        typeName - of the teiid type.
        Returns:
        A short value representing SQL Type for the given java type.
      • getSQLTypeFromClass

        public static final int getSQLTypeFromClass​(String className)
        Get sql Type from java class type name. This should not be called with runtime types as Clob and Blob are represented by ClobType and BlobType respectively.
        Parameters:
        className -
        Returns:
        int
      • getSQLTypeFromRuntimeType

        public static final int getSQLTypeFromRuntimeType​(Class<?> type)
        Get the sql type from the given runtime type
        Parameters:
        type -
        Returns:
        the SQL type code
      • getJavaClassName

        public static final String getJavaClassName​(int jdbcSQLType)
        This method is used to obtain a the java class name given an int value indicating JDBC SQL type. The int values that give the type info are from java.sql.Types.
        Parameters:
        jdbcSQLType - value giving the SQL type code.
        Returns:
        A String representing the java class name for the given SQL Type.
      • getTypeName

        public static final String getTypeName​(int sqlType)
      • getMMTypeNames

        public static Set<String> getMMTypeNames()
      • getMaxDisplaySize

        public static Integer getMaxDisplaySize​(Class<?> dataTypeClass)
      • getMaxDisplaySize

        public static Integer getMaxDisplaySize​(String typeName)
      • getDefaultPrecision

        public static Integer getDefaultPrecision​(Class<?> dataTypeClass)
      • getDefaultPrecision

        public static Integer getDefaultPrecision​(String typeName)