Here you can find the source of getValue(int type, ResultSet resultSet, int columnIndex)
private static Object getValue(int type, ResultSet resultSet, int columnIndex) throws SQLException
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Oobium, Inc./*w ww .j av a2 s. c om*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Jeremy Dowdall <jeremy@oobium.com> - initial API and implementation ******************************************************************************/ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; public class Main { private static Object getValue(int type, ResultSet resultSet, int columnIndex) throws SQLException { switch (type) { case Types.BLOB: return resultSet.getBytes(columnIndex); case Types.CLOB: return resultSet.getString(columnIndex); default: return resultSet.getObject(columnIndex); } } public static Object getValue(ResultSet resultSet, int columnIndex) throws SQLException { return getValue(resultSet.getMetaData().getColumnType(columnIndex), resultSet, columnIndex); } }