Java Utililty Methods SQL Type

List of utility methods to do SQL Type

Description

The list of methods to do SQL Type are organized into topic(s).

Method

booleanisNumberic(int type)
is Numberic
if (type == Types.INTEGER || type == Types.TINYINT || type == Types.SMALLINT || type == Types.DOUBLE
        || type == Types.FLOAT || type == Types.BIGINT) {
    return true;
} else {
    return false;
booleanisNumberType(int aSqlType)
Returns true if the passed datatype (from java.sql.Types) can hold a numeric value (either with or without decimals)
return (aSqlType == Types.BIGINT || aSqlType == Types.INTEGER || aSqlType == Types.DECIMAL
        || aSqlType == Types.DOUBLE || aSqlType == Types.FLOAT || aSqlType == Types.NUMERIC
        || aSqlType == Types.REAL || aSqlType == Types.SMALLINT || aSqlType == Types.TINYINT);
booleanisNumberType(int sqlType)
is Number Type
switch (sqlType) {
case Types.BIGINT:
case Types.DECIMAL:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.NUMERIC:
case Types.BIT:
...
booleanisNumeric(int dataType)
is Numeric
switch (dataType) {
case java.sql.Types.NUMERIC:
case java.sql.Types.DECIMAL:
case java.sql.Types.BIT:
case java.sql.Types.TINYINT:
case java.sql.Types.SMALLINT:
case java.sql.Types.INTEGER:
case java.sql.Types.BIGINT:
...
booleanisNumeric(int dataType)
is Numeric
List<Integer> numericTypes = Arrays.asList(Types.BIGINT, Types.BIT, Types.INTEGER, Types.SMALLINT,
        Types.TINYINT, Types.DECIMAL, Types.DOUBLE, Types.FLOAT, Types.NUMERIC, Types.REAL);
return numericTypes.contains(dataType);
booleanisNumeric(int pColumnType)
is Numeric
return (pColumnType == Types.INTEGER || pColumnType == Types.DECIMAL || pColumnType == Types.TINYINT
        || pColumnType == Types.BIGINT || pColumnType == Types.DOUBLE || pColumnType == Types.FLOAT
        || pColumnType == Types.NUMERIC || pColumnType == Types.REAL || pColumnType == Types.SMALLINT);
booleanisNumeric(int sqlType)
Check whether the given SQL type is numeric.
return Types.BIT == sqlType || Types.BIGINT == sqlType || Types.DECIMAL == sqlType
        || Types.DOUBLE == sqlType || Types.FLOAT == sqlType || Types.INTEGER == sqlType
        || Types.NUMERIC == sqlType || Types.REAL == sqlType || Types.SMALLINT == sqlType
        || Types.TINYINT == sqlType;
booleanisNumeric(int sqlType)
Check whether the given SQL type is numeric.
return (Types.BIT == sqlType) || (Types.BIGINT == sqlType) || (Types.DECIMAL == sqlType)
        || (Types.DOUBLE == sqlType) || (Types.FLOAT == sqlType) || (Types.INTEGER == sqlType)
        || (Types.NUMERIC == sqlType) || (Types.REAL == sqlType) || (Types.SMALLINT == sqlType)
        || (Types.TINYINT == sqlType);
booleanisNumericType(int datatype)
Check if the given SQL type is numeric data type
return datatype == Types.BIGINT || datatype == Types.DECIMAL || datatype == Types.DOUBLE
        || datatype == Types.FLOAT || datatype == Types.INTEGER || datatype == Types.NUMERIC
        || datatype == Types.REAL || datatype == Types.SMALLINT || datatype == Types.TINYINT;
booleanisNumericType(int type)
is Numeric Type
return Types.BIGINT == type || Types.DECIMAL == type || Types.INTEGER == type || Types.NUMERIC == type
        || Types.SMALLINT == type || Types.TINYINT == type;