Here you can find the source of getColumnMetaData(Connection conn, String table, String column)
protected static ResultSet getColumnMetaData(Connection conn, String table, String column) throws SQLException
//package com.java2s; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; public class Main { /**/*w ww .j av a 2 s . com*/ * Helper function for {@link #getColumnType}, etc. */ protected static ResultSet getColumnMetaData(Connection conn, String table, String column) throws SQLException { ResultSet rs = conn.getMetaData().getColumns("", "", table, column); while (rs.next()) { String tname = rs.getString("TABLE_NAME"); String cname = rs.getString("COLUMN_NAME"); if (tname.equals(table) && cname.equals(column)) { return rs; } } throw new SQLException("Table or Column not defined. [table=" + table + ", col=" + column + "]."); } }