Class DataTypeUtil


  • public class DataTypeUtil
    extends java.lang.Object
    Utility class for data types.
    • Constructor Summary

      Constructors 
      Constructor Description
      DataTypeUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int[] getCompatibleJavaTypes​(int javaType)  
      static int getJavaTypeFromValue​(java.lang.Object value)  
      static java.lang.Integer[] getJavaTypesArray()  
      static java.lang.Integer getTypeByName​(java.lang.String dataTypeName)
      Get the java type from java.sql.Types for the given data type name.
      static java.lang.String getTypeName​(int javaType)
      Get the type name for a given java type
      static boolean isBoolean​(int javaType)  
      static boolean isDate​(int javaType)  
      static boolean isInteger​(int javaType)  
      static boolean isLong​(int javaType)  
      static boolean isNumeric​(int javaType)  
      static boolean isTimestamp​(int javaType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DataTypeUtil

        public DataTypeUtil()
    • Method Detail

      • isTimestamp

        public static boolean isTimestamp​(int javaType)
      • isDate

        public static boolean isDate​(int javaType)
        Parameters:
        javaType - represented as integer from java.sql.Types.
        Returns:
        true if is representing a date
      • isBoolean

        public static boolean isBoolean​(int javaType)
        Parameters:
        javaType - represented as integer from java.sql.Types.
        Returns:
        true if is representing a boolean
      • isNumeric

        public static boolean isNumeric​(int javaType)
        Parameters:
        javaType - represented as integer from java.sql.Types.
        Returns:
        true if is representing a number ( integer, long, numeric, ... )
      • isInteger

        public static boolean isInteger​(int javaType)
      • isLong

        public static boolean isLong​(int javaType)
      • getTypeName

        public static java.lang.String getTypeName​(int javaType)
        Get the type name for a given java type
        Parameters:
        javaType - from java.sql.Types
        Returns:
        the type name
      • getJavaTypesArray

        public static java.lang.Integer[] getJavaTypesArray()
        Returns:
        An array of the JavaTypes from java.sql.Types
      • getTypeByName

        public static java.lang.Integer getTypeByName​(java.lang.String dataTypeName)
        Get the java type from java.sql.Types for the given data type name.
        Parameters:
        dataTypeName - as text
        Returns:
        javaType from java.sql.Types
      • getCompatibleJavaTypes

        public static int[] getCompatibleJavaTypes​(int javaType)
      • getJavaTypeFromValue

        public static int getJavaTypeFromValue​(java.lang.Object value)