Here you can find the source of lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex)
public static String lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.ResultSetMetaData; import java.sql.SQLException; public class Main { public static String lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex) throws SQLException { String name = resultSetMetaData.getColumnLabel(columnIndex); if (name == null || name.length() < 1) { name = resultSetMetaData.getColumnName(columnIndex); }//from ww w.java 2 s .co m return name; } }