Here you can find the source of getColumnValueFromResultSet(int columnIndex, int argType, ResultSet rs)
public static Object getColumnValueFromResultSet(int columnIndex, int argType, ResultSet rs) throws SQLException
//package com.java2s; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; public class Main { public static Object getColumnValueFromResultSet(int columnIndex, int argType, ResultSet rs) throws SQLException { switch (argType) { case Types.INTEGER: return new Integer(rs.getInt(columnIndex)); case Types.BOOLEAN: return new Boolean(rs.getBoolean(columnIndex)); case Types.FLOAT: return new Float(rs.getFloat(columnIndex)); case Types.DOUBLE: return new Double(rs.getDouble(columnIndex)); case Types.CHAR: case Types.VARCHAR: return rs.getString(columnIndex); case Types.DATE: return rs.getDate(columnIndex); case Types.TIMESTAMP: return rs.getTimestamp(columnIndex); default:// w w w. j a v a 2 s.co m return rs.getObject(columnIndex); } } }