|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.value.DataType
public class DataType
This class contains meta data information about data types, and can convert between Java objects and Values.
Field Summary | |
---|---|
boolean |
autoIncrement
If this is an autoincrement type. |
boolean |
caseSensitive
If this data type is an autoincrement type. |
boolean |
decimal
If this is a numeric type. |
int |
defaultDisplaySize
The default display size. |
long |
defaultPrecision
The default precision. |
int |
defaultScale
The default scale. |
boolean |
hidden
If this data type should not be listed in the database meta data. |
java.lang.String |
jdbc
The Java class name. |
long |
maxPrecision
The maximum supported precision. |
int |
maxScale
The highest possible scale. |
int |
memory
The number of bytes required for an object. |
int |
minScale
The lowest possible scale. |
java.lang.String |
name
The data type name. |
java.lang.String |
params
The list of parameters used in the column definition. |
java.lang.String |
prefix
The prefix required for the SQL literal representation. |
int |
sqlType
The SQL type. |
int |
sqlTypePos
How closely the data type maps to the corresponding JDBC SQL type (low is best). |
java.lang.String |
suffix
The suffix required for the SQL literal representation. |
boolean |
supportsPrecision
If the precision parameter is supported. |
boolean |
supportsScale
If the scale parameter is supported. |
int |
type
The value type of this data type. |
static int |
TYPE_BOOLEAN
This constant is used for JDK 1.3 compatibility and equal to java.sql.Types.BOOLEAN |
static int |
TYPE_DATALINK
This constant is used for JDK 1.3 compatibility and equal to java.sql.Types.DATALINK |
static int |
TYPE_LONGNVARCHAR
This constant is used for JDK 1.5 compatibility and equal to java.sql.Types.LONGNVARCHAR |
static int |
TYPE_NCHAR
This constant is used for JDK 1.5 compatibility and equal to java.sql.Types.NCHAR |
static int |
TYPE_NCLOB
This constant is used for JDK 1.5 compatibility and equal to java.sql.Types.NCLOB |
static int |
TYPE_NVARCHAR
This constant is used for JDK 1.5 compatibility and equal to java.sql.Types.NVARCHAR |
Constructor Summary | |
---|---|
DataType()
|
Method Summary | |
---|---|
static int |
convertSQLTypeToValueType(int sqlType)
Convert a SQL type to a value type. |
static java.lang.Object |
convertTo(SessionInterface session,
JdbcConnection conn,
Value v,
java.lang.Class<?> paramClass)
Convert a value to the specified class. |
static Value |
convertToValue(SessionInterface session,
java.lang.Object x,
int type)
Convert a Java object to a value. |
static int |
convertTypeToSQLType(int type)
Convert a value type to a SQL type. |
static int |
getAddProofType(int type)
Get the data type that will not overflow when calling 'add' 2 billion times. |
static DataType |
getDataType(int type)
Get the data type object for the given value type. |
static java.lang.Object |
getDefaultForPrimitiveType(java.lang.Class<?> clazz)
Get the default value in the form of a Java object for the given Java class. |
static DataType |
getTypeByName(java.lang.String s)
Get a data type object from a type name. |
static java.lang.String |
getTypeClassName(int type)
Get the name of the Java class for the given value type. |
static int |
getTypeFromClass(java.lang.Class<?> x)
Get the value type for the given Java class. |
static java.util.ArrayList<DataType> |
getTypes()
Get the list of data types. |
static boolean |
isLargeObject(int type)
Check if the given value type is a large object (BLOB or CLOB). |
static Value |
readValue(SessionInterface session,
java.sql.ResultSet rs,
int columnIndex,
int type)
Read a value from the given result set. |
static boolean |
supportsAdd(int type)
Check if the given value type supports the add operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_BOOLEAN
public static final int TYPE_DATALINK
public static final int TYPE_LONGNVARCHAR
public static final int TYPE_NCHAR
public static final int TYPE_NVARCHAR
public static final int TYPE_NCLOB
public int type
public java.lang.String name
public int sqlType
public java.lang.String jdbc
public int sqlTypePos
public long maxPrecision
public int minScale
public int maxScale
public boolean decimal
public java.lang.String prefix
public java.lang.String suffix
public java.lang.String params
public boolean autoIncrement
public boolean caseSensitive
public boolean supportsPrecision
public boolean supportsScale
public long defaultPrecision
public int defaultScale
public int defaultDisplaySize
public boolean hidden
public int memory
Constructor Detail |
---|
public DataType()
Method Detail |
---|
public static java.util.ArrayList<DataType> getTypes()
public static Value readValue(SessionInterface session, java.sql.ResultSet rs, int columnIndex, int type) throws java.sql.SQLException
session
- the sessionrs
- the result setcolumnIndex
- the column index (1 based)type
- the data type
java.sql.SQLException
public static java.lang.String getTypeClassName(int type)
type
- the value type
public static DataType getDataType(int type)
type
- the value type
public static int convertTypeToSQLType(int type)
type
- the value type
public static int convertSQLTypeToValueType(int sqlType) throws java.sql.SQLException
sqlType
- the SQL type
java.sql.SQLException
public static int getTypeFromClass(java.lang.Class<?> x) throws java.sql.SQLException
x
- the Java class
java.sql.SQLException
public static Value convertToValue(SessionInterface session, java.lang.Object x, int type) throws java.sql.SQLException
session
- the sessionx
- the valuetype
- the value type
java.sql.SQLException
public static DataType getTypeByName(java.lang.String s)
s
- the type name
public static boolean isLargeObject(int type)
type
- the value type
public static boolean supportsAdd(int type)
type
- the value type
public static int getAddProofType(int type)
type
- the value type
public static java.lang.Object getDefaultForPrimitiveType(java.lang.Class<?> clazz)
clazz
- the Java class
public static java.lang.Object convertTo(SessionInterface session, JdbcConnection conn, Value v, java.lang.Class<?> paramClass) throws java.sql.SQLException
session
- the sessionconn
- the database connectionv
- the valueparamClass
- the target class
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |