org.tinygroup.dbrouter.value
类 DataType

java.lang.Object
  继承者 org.tinygroup.dbrouter.value.DataType

public class DataType
extends Object

This class contains meta data information about data types, and can convert between Java objects and Values.


字段摘要
static int TYPE_RESULT_SET
          This constant is used to represent the type of a ResultSet.
 
构造方法摘要
DataType()
           
 
方法摘要
static int convertSQLTypeToValueType(int sqlType)
          Convert a SQL type to a value 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.
 int getDefaultDisplaySize()
           
static Object getDefaultForPrimitiveType(Class<?> clazz)
          Get the default value in the form of a Java object for the given Java class.
 long getDefaultPrecision()
           
 int getDefaultScale()
           
 String getJdbc()
           
 long getMaxPrecision()
           
 int getMaxScale()
           
 int getMinScale()
           
 String getName()
           
static Class<?> getNonPrimitiveClass(Class<?> clazz)
          Convert primitive class names to java.lang.* class names.
 String getParams()
           
 String getPrefix()
           
 int getSqlType()
           
 int getSqlTypePos()
           
 String getSuffix()
           
 int getType()
           
static DataType getTypeByName(String s)
          Get a data type object from a type name.
static String getTypeClassName(int type)
          Get the name of the Java class for the given value type.
static int getTypeFromClass(Class<?> x)
          Get the value type for the given Java class.
static List<DataType> getTypes()
          Get the list of data types.
 boolean isAutoIncrement()
           
 boolean isCaseSensitive()
           
 boolean isDecimal()
           
 boolean isHidden()
           
static boolean isLargeObject(int type)
          Check if the given value type is a large object (BLOB or CLOB).
static boolean isStringType(int type)
          Check if the given value type is a String (VARCHAR,...).
 boolean isSupportsPrecision()
           
 boolean isSupportsScale()
           
static boolean supportsAdd(int type)
          Check if the given value type supports the add operation.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

TYPE_RESULT_SET

public static final int TYPE_RESULT_SET
This constant is used to represent the type of a ResultSet. There is no equivalent java.sql.Types value, but Oracle uses it to represent a ResultSet (OracleTypes.CURSOR = -10).

另请参见:
常量字段值
构造方法详细信息

DataType

public DataType()
方法详细信息

getTypes

public static List<DataType> getTypes()
Get the list of data types.

返回:
the list

getTypeClassName

public static String getTypeClassName(int type)
Get the name of the Java class for the given value type.

参数:
type - the value type
返回:
the class name

convertSQLTypeToValueType

public static int convertSQLTypeToValueType(int sqlType)
Convert a SQL type to a value type.

参数:
sqlType - the SQL type
返回:
the value type

getTypeFromClass

public static int getTypeFromClass(Class<?> x)
Get the value type for the given Java class.

参数:
x - the Java class
返回:
the value type

getNonPrimitiveClass

public static Class<?> getNonPrimitiveClass(Class<?> clazz)
Convert primitive class names to java.lang.* class names.

参数:
clazz - the class (for example: int)
返回:
the non-primitive class (for example: java.lang.Integer)

isLargeObject

public static boolean isLargeObject(int type)
Check if the given value type is a large object (BLOB or CLOB).

参数:
type - the value type
返回:
true if the value type is a lob type

isStringType

public static boolean isStringType(int type)
Check if the given value type is a String (VARCHAR,...).

参数:
type - the value type
返回:
true if the value type is a String type

supportsAdd

public static boolean supportsAdd(int type)
Check if the given value type supports the add operation.

参数:
type - the value type
返回:
true if add is supported

getAddProofType

public static int getAddProofType(int type)
Get the data type that will not overflow when calling 'add' 2 billion times.

参数:
type - the value type
返回:
the data type that supports adding

getDefaultForPrimitiveType

public static Object getDefaultForPrimitiveType(Class<?> clazz)
Get the default value in the form of a Java object for the given Java class.

参数:
clazz - the Java class
返回:
the default object

getDataType

public static DataType getDataType(int type)
Get the data type object for the given value type.

参数:
type - the value type
返回:
the data type object

getTypeByName

public static DataType getTypeByName(String s)
Get a data type object from a type name.

参数:
s - the type name
返回:
the data type object

getType

public int getType()

getName

public String getName()

getSqlType

public int getSqlType()

getJdbc

public String getJdbc()

getSqlTypePos

public int getSqlTypePos()

getMaxPrecision

public long getMaxPrecision()

getMinScale

public int getMinScale()

getMaxScale

public int getMaxScale()

isDecimal

public boolean isDecimal()

getPrefix

public String getPrefix()

getSuffix

public String getSuffix()

getParams

public String getParams()

isAutoIncrement

public boolean isAutoIncrement()

isCaseSensitive

public boolean isCaseSensitive()

isSupportsPrecision

public boolean isSupportsPrecision()

isSupportsScale

public boolean isSupportsScale()

getDefaultPrecision

public long getDefaultPrecision()

getDefaultScale

public int getDefaultScale()

getDefaultDisplaySize

public int getDefaultDisplaySize()

isHidden

public boolean isHidden()


Copyright © 2006–2015 TinyGroup. All rights reserved.