Here you can find the source of getJavaTypeNameByJdbcType(int jdbcType)
Parameter | Description |
---|---|
jdbcType | a parameter |
public static Class getJavaTypeNameByJdbcType(int jdbcType)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.sql.Time; import java.sql.Timestamp; import java.sql.Types; import java.util.Date; public class Main { /**/*from w ww . ja v a2 s. co m*/ * @param jdbcType * @return Class */ public static Class getJavaTypeNameByJdbcType(int jdbcType) { switch (jdbcType) { case Types.BIT: { return Boolean.class; } case Types.TINYINT: { return Byte.class; } case Types.SMALLINT: { return Short.class; } case Types.INTEGER: { return Integer.class; } case Types.BIGINT: { return Long.class; } case Types.DOUBLE: case Types.FLOAT: { return Double.class; } case Types.REAL: { return Float.class; } case Types.NUMERIC: { return Boolean.class; } case Types.DECIMAL: { return BigDecimal.class; } case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: { return String.class; } case Types.DATE: { return Date.class; } case Types.TIME: { return Time.class; } case Types.TIMESTAMP: { return Timestamp.class; } case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.CLOB: case Types.BLOB: case Types.STRUCT: { return Object.class; } default: { return Object.class; } } } }