Here you can find the source of getObjectByTypeCoercion(ResultSet resultSet, int index, int dataType)
public static Object getObjectByTypeCoercion(ResultSet resultSet, int index, int dataType) throws SQLException
//package com.java2s; /******************************************************************************* * Copyright (c) 2005, 2010 Sybase, Inc. and others * 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://from w w w.j a v a 2 s . c o m * Sybase, Inc. - initial API and implementation *******************************************************************************/ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; public class Main { public static Object getObjectByTypeCoercion(ResultSet resultSet, int index, int dataType) throws SQLException { switch (dataType) { case Types.TIMESTAMP: return resultSet.getTimestamp(index); case Types.CLOB: return resultSet.getString(index); case Types.BLOB: return resultSet.getString(index); default: return resultSet.getObject(index); } } }