Here you can find the source of toClass(int sqlType, boolean isUnsigned)
public static Class toClass(int sqlType, boolean isUnsigned) throws SQLException
//package com.java2s; //License from project: Apache License import java.lang.reflect.Array; import java.math.BigDecimal; import java.math.BigInteger; import java.sql.SQLException; import java.sql.Time; import java.sql.Timestamp; import java.sql.Types; public class Main { public static Class toClass(int sqlType, boolean isUnsigned) throws SQLException { return toClass(sqlType, -1, isUnsigned); }//from w w w.j a v a 2 s . co m public static Class toClass(int sqlType, int elementSqltype, boolean isUnsigned) throws SQLException { switch (sqlType) { case Types.BIT: case Types.BOOLEAN: return Boolean.class; case Types.TINYINT: case Types.SMALLINT: case Types.INTEGER: if (isUnsigned) return Long.class; return Integer.class; case Types.BIGINT: if (isUnsigned) return BigInteger.class; return Long.class; case Types.DOUBLE: return Double.class; case Types.NUMERIC: case Types.DECIMAL: return BigDecimal.class; case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: case Types.BLOB: return String.class; case Types.FLOAT: case Types.REAL: return Float.class; case Types.DATE: return java.sql.Date.class; case Types.TIMESTAMP: return Timestamp.class; case Types.TIME: return Time.class; case Types.ARRAY: Class elementType = toClass(elementSqltype, isUnsigned); return Array.newInstance(elementType, 0).getClass(); default: throw new UnsupportedOperationException("Sql type " + sqlType + "is not supported"); } } }