public enum DataType extends Enum<DataType>
The class that defines the constants that are used to identify SQL types.
Enum Constant and Description |
---|
BIGINT
64-bit signed integer value between -9223372036854775808 and
9223372036854775807.
|
BINARY
Fixed length binary value.
|
BLOB
Big variable length binary value.
|
BOOLEAN
1-bit value, which is either 1 or 0, true of false.
|
CHAR
Fixed length character string.
|
CLOB
Big variable length character string.
|
DATE
Day, month and year.
|
DECIMAL
Lax fixed-precision decimal number which takes precision and scale
parameters.
|
DOUBLE
Double precision floating point number that supports 15 digits of
mantissa.
|
FLOAT
Double precision floating point number that supports 15 digits of
mantissa, basically the same type as
DOUBLE , which should be
preferred instead of FLOAT. |
INTEGER
32-bit signed integer value between -2147483648 and 2147483647.
|
LONGVARBINARY
Big variable length binary value with length param.
|
LONGVARCHAR
Big variable length character string with length param.
|
NUMERIC
Severe fixed-precision decimal number which takes precision and scale
parameters.
|
OBJECT
Object and Others
|
REAL
Single precision floating point number that supports 7 digits of
mantissa.
|
SMALLINT
16-bit signed integer value between -32768 and 32767.
|
TIME
Hours, minutes and seconds.
|
TIMESTAMP
|
TINYINT
8-bit integer value between 0 and 255, signed or unsigned.
|
VARBINARY
Small variable length binary value with length param.
|
VARCHAR
Small variable length character string with length param.
|
Modifier and Type | Method and Description |
---|---|
static DataType |
get(int sqlType)
Returns the matching
DataType for the sqlType . |
static List<DataType> |
getBlobTypes()
|
static List<DataType> |
getDateTypes()
|
static List<DataType> |
getDecimalTypes()
|
static List<DataType> |
getIntTypes()
|
Class<?> |
getJavaClass()
Gets the java class for this
DataType . |
static List<DataType> |
getNumericTypes()
|
SQL.DATATYPE |
getSqlType()
Gets the sql type for this
DataType . |
static List<DataType> |
getStringTypes()
|
boolean |
hasLength()
Verify if this
DataType has a length. |
boolean |
hasScale()
Verify if this
DataType has a scale. |
boolean |
isBlob()
Check if
this is an blob DataType . |
boolean |
isDate()
Check if
this is an date DataType . |
boolean |
isDecimal()
Check if
this is an decimal DataType . |
boolean |
isInt()
Check if
this is an integer DataType . |
boolean |
isNumeric()
Check if
this is numeric DataType . |
boolean |
isString()
Check if
this is an string DataType . |
static DataType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DataType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DataType TINYINT
public static final DataType SMALLINT
public static final DataType INTEGER
public static final DataType BIGINT
public static final DataType REAL
public static final DataType DOUBLE
public static final DataType FLOAT
DOUBLE
, which should be
preferred instead of FLOAT.public static final DataType NUMERIC
public static final DataType DECIMAL
public static final DataType BOOLEAN
public static final DataType CHAR
public static final DataType VARCHAR
public static final DataType LONGVARCHAR
public static final DataType CLOB
public static final DataType BINARY
public static final DataType VARBINARY
public static final DataType LONGVARBINARY
public static final DataType BLOB
public static final DataType DATE
public static final DataType TIME
public static final DataType OBJECT
public static final DataType TIMESTAMP
public static DataType[] values()
for (DataType c : DataType.values()) System.out.println(c);
public static DataType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Class<?> getJavaClass()
DataType
.public SQL.DATATYPE getSqlType()
DataType
.SQL.DATATYPE
public boolean isInt()
true
if this is an integer DataType
,
otherwise false
public boolean isDecimal()
true
if this is an decimal DataType
,
otherwise false
public boolean isNumeric()
true
if this is a numeric value DataType
,
otherwise false
public boolean isString()
true
if this is an string DataType
,
otherwise false
public boolean isBlob()
true
if this is an blob DataType
, otherwise
false
public boolean isDate()
true
if this is an date DataType
, otherwise
false
public boolean hasLength()
DataType
has a length.true
if the DataType
has a length, otherwise
false
hasScale()
public boolean hasScale()
DataType
has a scale.true
if the DataType
has a scale, otherwise
false
hasLength()
public static List<DataType> getStringTypes()
DataType
s.public static List<DataType> getNumericTypes()
DataType
s.public static List<DataType> getBlobTypes()
DataType
s.public static List<DataType> getDecimalTypes()
DataType
s.Copyright © 2003–2021 XDEV Software. All rights reserved.