Package com.kheops.util
Class TypesUtil
java.lang.Object
com.kheops.util.TypesUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectstatic StringgetSQLType(int type) This method returns the name that defines a SQL type Id.static JDBCTypegetSQLType(Class<?> clazz) static intgetSQLType(Object o) This method returns the equivalent SQL data type for a Java object.static booleanisSQLTypeBinary(int type) Return a boolean that indicates if a SQL type is binary or other than current typestatic booleanisSQLTypeNumeric(int type) Return a boolean that indicates if a SQL type is numericstatic booleanisSQLTypeReal(int type) Return a boolean that indicates if a SQL type is numericstatic booleanisSQLTypeString(int type) static booleanisSQLTypeTimeStamp(int type) Return a boolean that indicates if a SQL type is TimeStampstatic Class<?> sqlTypeToClass(int type) Returns the Java class associated with a SQL type.
-
Constructor Details
-
TypesUtil
public TypesUtil()
-
-
Method Details
-
convert
- Throws:
Exception
-
getSQLType
This method returns the name that defines a SQL type Id.- Parameters:
type- an SQL type Id.- Returns:
- the name that defines a SQL type.
-
getSQLType
-
getSQLType
This method returns the equivalent SQL data type for a Java object.- Parameters:
o- a Java object- Returns:
- the SQL type Id.
-
isSQLTypeNumeric
public static boolean isSQLTypeNumeric(int type) Return a boolean that indicates if a SQL type is numeric- Parameters:
type- the SQL type- Returns:
- a boolean that indicates if the SQL type is numeric
-
isSQLTypeReal
public static boolean isSQLTypeReal(int type) Return a boolean that indicates if a SQL type is numeric- Parameters:
type- the SQL type- Returns:
- a boolean that indicates if the SQL type is numeric
-
isSQLTypeString
public static boolean isSQLTypeString(int type) -
isSQLTypeTimeStamp
public static boolean isSQLTypeTimeStamp(int type) Return a boolean that indicates if a SQL type is TimeStamp- Parameters:
type- the SQL type- Returns:
- a boolean that indicates if the SQL type is TimeStamp
-
isSQLTypeBinary
public static boolean isSQLTypeBinary(int type) Return a boolean that indicates if a SQL type is binary or other than current type- Parameters:
type- the SQL type- Returns:
- a boolean that indicates if the SQL type is binary or other than current type
-
sqlTypeToClass
Returns the Java class associated with a SQL type.- Parameters:
type- the sql type- Returns:
- the associated java class; if none,
Objectclass is returned - See Also:
-