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

booleanisStringType(int dataType)
is String Type
switch (dataType) {
case Types.CHAR:
case Types.VARCHAR:
case Types.LONGVARCHAR:
case Types.NCHAR:
case Types.NVARCHAR:
case Types.LONGNVARCHAR:
    return true;
...
booleanisStringType(int sqlType)
Returns true if the given sqlType identifier is a String data type
switch (sqlType) {
case Types.CHAR:
case Types.VARCHAR:
case Types.NCHAR:
case Types.NVARCHAR: {
    return (true);
default:
...
booleanisStringType(int sqlType)
is String Type
return Arrays.binarySearch(STRING_TYPES, sqlType) >= 0;
booleanisStringType(int type)
Returns true if type is some string-like type: CHAR, VARCHAR.
return (type == Types.VARCHAR) || (type == Types.CHAR);
booleanisStringType(int type)
is String Type
return type == Types.CHAR || type == Types.NCHAR || type == Types.VARCHAR || type == Types.LONGVARCHAR
        || type == Types.NVARCHAR;
booleanisSupportedDataType(int type, String typeName)
is Supported Data Type
switch (type) {
case Types.BLOB:
case Types.BINARY:
case Types.VARBINARY:
case Types.STRUCT:
case Types.DISTINCT:
case Types.REF:
case Types.JAVA_OBJECT:
...
booleanisTableMissing(Connection con)
is Table Missing
for (String table : tables) {
    if (!tableExists(table, con)) {
        return true;
return false;
booleanisTextType(int columnType)
is Text Type
if (columnType == Types.CHAR || columnType == Types.DATE || columnType == Types.LONGNVARCHAR
        || columnType == Types.NCHAR || columnType == Types.NVARCHAR || columnType == Types.TIME
        || columnType == Types.TIMESTAMP || columnType == Types.VARCHAR || columnType == Types.OTHER)
    return true;
else
    return false;
booleanisValidReaderOrStream(final Object o)
is Valid Reader Or Stream
if (o instanceof byte[]) {
    return true;
if (o instanceof Blob) {
    return true;
if (o instanceof InputStream) {
    return true;
...
booleanisXMLType(int type)
is XML Type
return (type == Types.SQLXML);