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 class
JDBCSQLTypeInfo.TypeInfo
-
Field Summary
Fields Modifier and Type Field Description static Integer
DEFAULT_RADIX
static Integer
DEFAULT_SCALE
static Integer
XML_COLUMN_LENGTH
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Integer
getDefaultPrecision(Class<?> dataTypeClass)
static Integer
getDefaultPrecision(String typeName)
static String
getJavaClassName(int jdbcSQLType)
This method is used to obtain a the java class name given an int value indicating JDBC SQL type.static Integer
getMaxDisplaySize(Class<?> dataTypeClass)
static Integer
getMaxDisplaySize(String typeName)
static Set<String>
getMMTypeNames()
static int
getSQLType(String typeName)
This method is used to obtain a short indicating JDBC SQL type for any object.static int
getSQLTypeFromClass(String className)
Get sql Type from java class type name.static int
getSQLTypeFromRuntimeType(Class<?> type)
Get the sql type from the given runtime typestatic String
getTypeName(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)
-
-