Java SQL Table Column lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex)

Here you can find the source of lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex)

Description

lookup Column Name

License

Apache License

Declaration

public static String lookupColumnName(ResultSetMetaData resultSetMetaData, int columnIndex)
        throws SQLException 

Method Source Code

//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;
    }
}

Related

  1. isColumnNullable(Connection conn, String table, String column)
  2. isColumnNullable(Connection conn, String table, String column)
  3. isNull(ResultSet resultSet, String columnName)
  4. lookupColumnIndex(final ResultSetMetaData resultSetMetaData, final String columnName)
  5. lookupColumnIndex(ResultSetMetaData resultSetMetaData, String name)
  6. printTableColumn(Connection conn, String sql)
  7. readMultiDouble(ResultSet resultSet, String columnName)
  8. readString(final ResultSet resultSet, final String columnName)
  9. readStringFromBlob(ResultSet resultSet, String columnLabel)