Package org.teiid.core.types
Class JDBCSQLTypeInfo
- java.lang.Object
-
- org.teiid.core.types.JDBCSQLTypeInfo
-
public final class JDBCSQLTypeInfo extends Object
This is a helper class used to obtain SQL type information for java types. The SQL type information is obtained from java.sql.Types class. The integers and strings returned by methods in this class are based on constants in java.sql.Types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJDBCSQLTypeInfo.TypeInfo
-
Field Summary
Fields Modifier and Type Field Description static IntegerDEFAULT_RADIXstatic IntegerDEFAULT_SCALEstatic IntegerXML_COLUMN_LENGTH
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IntegergetDefaultPrecision(Class<?> dataTypeClass)static IntegergetDefaultPrecision(String typeName)static StringgetJavaClassName(int jdbcSQLType)This method is used to obtain a the java class name given an int value indicating JDBC SQL type.static IntegergetMaxDisplaySize(Class<?> dataTypeClass)static IntegergetMaxDisplaySize(String typeName)static Set<String>getMMTypeNames()static intgetSQLType(String typeName)This method is used to obtain a short indicating JDBC SQL type for any object.static intgetSQLTypeFromClass(String className)Get sql Type from java class type name.static intgetSQLTypeFromRuntimeType(Class<?> type)Get the sql type from the given runtime typestatic StringgetTypeName(int sqlType)
-
-
-
Method Detail
-
getSQLType
public static final int getSQLType(String typeName)
This method is used to obtain a short indicating JDBC SQL type for any object. The short values that give the type info are from java.sql.Types.- Parameters:
typeName- of the teiid type.- Returns:
- A short value representing SQL Type for the given java type.
-
getSQLTypeFromClass
public static final int getSQLTypeFromClass(String className)
Get sql Type from java class type name. This should not be called with runtime types as Clob and Blob are represented by ClobType and BlobType respectively.- Parameters:
className-- Returns:
- int
-
getSQLTypeFromRuntimeType
public static final int getSQLTypeFromRuntimeType(Class<?> type)
Get the sql type from the given runtime type- Parameters:
type-- Returns:
- the SQL type code
-
getJavaClassName
public static final String getJavaClassName(int jdbcSQLType)
This method is used to obtain a the java class name given an int value indicating JDBC SQL type. The int values that give the type info are from java.sql.Types.- Parameters:
jdbcSQLType- value giving the SQL type code.- Returns:
- A String representing the java class name for the given SQL Type.
-
getTypeName
public static final String getTypeName(int sqlType)
-
-