A class that maps SQL type names to their JDBC type ID found in
java.sql.Types
.
-------------------------------------------------------
SQL Type | Java Type | Peer Type
-------------------------------------------------------
CHAR | String | String
VARCHAR | String | String
LONGVARCHAR | String | String
NUMERIC | java.math.BigDecimal | java.math.BigDecimal
DECIMAL | java.math.BigDecimal | java.math.BigDecimal
BIT | boolean OR Boolean | Boolean
TINYINT | byte OR Byte | Byte
SMALLINT | short OR Short | Short
INTEGER | int OR Integer | Integer
BIGINT | long OR Long | Long
REAL | float OR Float | Float
FLOAT | double OR Double | Double
DOUBLE | double OR Double | Double
BINARY | byte[] | ?
VARBINARY | byte[] | ?
LONGVARBINARY | byte[] | ?
DATE | java.sql.Date | java.util.Date
TIME | java.sql.Time | java.util.Date
TIMESTAMP | java.sql.Timestamp | java.util.Date
-------------------------------------------------------
A couple variations have been introduced to cover cases
that may arise, but are not covered above
BOOLEANCHAR | boolean OR Boolean | String
BOOLEANINT | boolean OR Boolean | Integer
BIGINT
public static final String BIGINT
BINARY
public static final String BINARY
BIT
public static final String BIT
BLOB
public static final String BLOB
BOOLEANCHAR
public static final String BOOLEANCHAR
BOOLEANINT
public static final String BOOLEANINT
CHAR
public static final String CHAR
CLOB
public static final String CLOB
DATE
public static final String DATE
DECIMAL
public static final String DECIMAL
DOUBLE
public static final String DOUBLE
FLOAT
public static final String FLOAT
INTEGER
public static final String INTEGER
LONGVARBINARY
public static final String LONGVARBINARY
LONGVARCHAR
public static final String LONGVARCHAR
NUMERIC
public static final String NUMERIC
REAL
public static final String REAL
SMALLINT
public static final String SMALLINT
TIME
public static final String TIME
TIMESTAMP
public static final String TIMESTAMP
TINYINT
public static final String TINYINT
VARBINARY
public static final String VARBINARY
VARCHAR
public static final String VARCHAR
getJdbcTypeCode
public static int getJdbcTypeCode(String typeName)
Returns the JDBC type name which maps to java.sql.Types
for the given SQL name of type
getJdbcTypeName
public static String getJdbcTypeName(int typeCode)
Returns the name which maps to the given java.sql.Types
type code
isDecimalType
public static final boolean isDecimalType(String type)
Returns true if values for the type need have size and scale measurements
type
- The type to check.
isDecimalType
public static final boolean isDecimalType(int type)
Returns true if values for the type need have size and scale measurements
type
- The type to check.
isTextType
public static final boolean isTextType(String type)
Returns true if values for the type need to be quoted.
type
- The type to check.
isTextType
public static final boolean isTextType(int type)
Returns true if values for the type need to be quoted.
type
- The type to check.
registerSqlTypeID
protected static void registerSqlTypeID(Integer sqlTypeID,
String name)
Registers the fact that the given Integer SQL ID maps to the given SQL name