Here you can find the source of getClassName(ResultSetMetaData meta, int index)
public static String getClassName(ResultSetMetaData meta, int index) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.*; public class Main { /**/*from w ww.ja v a 2s.c o m*/ * Returns a column's java class name. */ public static String getClassName(ResultSetMetaData meta, int index) throws SQLException { switch (meta.getColumnType(index)) { case Types.NUMERIC: int precision = meta.getPrecision(index); if (meta.getScale(index) == 0) { if (precision > 18) { return "java.math.BigInteger"; } else if (precision > 9) { return "java.lang.Long"; } else if (precision > 4) { return "java.lang.Integer"; } else if (precision > 2) { return "java.lang.Short"; } else { return "java.lang.Byte"; } } else { if (precision > 16) { return "java.math.BigDecimal"; } else if (precision > 7) { return "java.lang.Double"; } else { return "java.lang.Float"; } } case Types.TIMESTAMP: if (meta.getScale(index) == 0) { return "java.sql.Date"; } else { return "java.sql.Timestamp"; } default: return meta.getColumnClassName(index); } } }