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

booleanisBoolean(int ct)
is Boolean
return (ct == java.sql.Types.BIT || ct == java.sql.Types.BOOLEAN);
booleanisBoolean(int dataType)
is Boolean
switch (dataType) {
case java.sql.Types.BIT:
case java.sql.Types.BOOLEAN:
    return true;
default:
    return false;
booleanisBoolean(int dataType)
is Boolean
return dataType == Types.BOOLEAN;
booleanisCharacterTypeWithLength(int aSqlType)
Returns true if the given JDBC type is a CHAR or VARCHAR type
return (aSqlType == Types.VARCHAR || aSqlType == Types.CHAR || aSqlType == Types.NVARCHAR
        || aSqlType == Types.NCHAR);
booleanisClobType(int sqlType)
is Clob Type
if (sqlType == Types.CLOB || sqlType == Types.LONGVARCHAR || sqlType == Types.NCLOB
        || sqlType == Types.LONGNVARCHAR) {
    return true;
} else {
    return false;
booleanisDataNeedsQuotes(int type)
is Data Needs Quotes
switch (type) {
case Types.BIGINT:
    return false;
case Types.BOOLEAN:
    return false;
case Types.DECIMAL:
    return false;
case Types.DOUBLE:
...
booleanisDigitalType(int sqlType)
is Digital Type
switch (sqlType) {
case Types.NUMERIC:
case Types.DECIMAL:
case Types.SMALLINT:
case Types.INTEGER:
case Types.BIGINT:
case Types.REAL:
case Types.FLOAT:
...
booleanisJDBCType(final int type)
This function returns true if the value type maps to a valid JDBC Type.
switch (type) {
case Types.ARRAY:
case Types.BIGINT:
case Types.BINARY:
case Types.BIT:
case Types.BLOB:
case Types.CHAR:
case Types.CLOB:
...
booleanisLobColumn(int dataType)
is Lob Column
boolean lob = false;
switch (dataType) {
case Types.BLOB:
    lob = true;
    break;
case Types.CLOB:
    lob = true;
    break;
...
booleanisNativeType(final Class type)
Returns true if the provided class is a type supported natively (as opposed to a bean).
return (type == boolean.class || type == Boolean.class || type == byte.class || type == Byte.class
        || type == short.class || type == Short.class || type == int.class || type == Integer.class
        || type == long.class || type == Long.class || type == float.class || type == Float.class
        || type == double.class || type == Double.class || type == char.class || type == Character.class
        || type == byte[].class || type == Byte[].class || type == char[].class || type == Character[].class
        || type == String.class || type == BigDecimal.class || type == java.util.Date.class
        || type == java.sql.Date.class || type == java.sql.Time.class || type == java.sql.Timestamp.class
        || type == java.io.InputStream.class || type == java.io.Reader.class || type == java.sql.Clob.class
...