Here you can find the source of resultSetValue(ResultSet resultSet, Class> parameterClass, Object object, String columnLabel)
private static Object resultSetValue(ResultSet resultSet, Class<?> parameterClass, Object object, String columnLabel) throws SQLException
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Date; public class Main { private static Object resultSetValue(ResultSet resultSet, Class<?> parameterClass, Object object, String columnLabel) throws SQLException { Object value = null;//w w w . j a v a2s . c om if (parameterClass.equals(String.class)) { value = resultSet.getString(columnLabel); } else if (parameterClass.equals(Integer.class)) { value = resultSet.getInt(columnLabel); } else if (parameterClass.equals(Float.class)) { value = resultSet.getFloat(columnLabel); } else if (parameterClass.equals(Long.class)) { value = resultSet.getLong(columnLabel); } else if (parameterClass.equals(Double.class)) { value = resultSet.getDouble(columnLabel); } else if (parameterClass.equals(Short.class)) { value = resultSet.getShort(columnLabel); } else if (parameterClass.equals(Date.class)) { value = resultSet.getTimestamp(columnLabel); } else if (parameterClass.equals(BigDecimal.class)) { value = resultSet.getBigDecimal(columnLabel); } else { value = object; } return value; } private static Object resultSetValue(ResultSet resultSet, Class<?> parameterClass, Object object, Integer columnIndex) throws SQLException { Object value = null; if (parameterClass.equals(String.class)) { value = resultSet.getString(columnIndex); } else if (parameterClass.equals(Integer.class)) { value = resultSet.getInt(columnIndex); } else if (parameterClass.equals(Float.class)) { value = resultSet.getFloat(columnIndex); } else if (parameterClass.equals(Long.class)) { value = resultSet.getLong(columnIndex); } else if (parameterClass.equals(Double.class)) { value = resultSet.getDouble(columnIndex); } else if (parameterClass.equals(Short.class)) { value = resultSet.getShort(columnIndex); } else if (parameterClass.equals(Date.class)) { value = resultSet.getTimestamp(columnIndex); } else if (parameterClass.equals(BigDecimal.class)) { value = resultSet.getBigDecimal(columnIndex); } else { value = object; } return value; } }