String columnName = columns[j].getColumnName();
// Check if column exists in database
// method "getColumnIndex()" throws NoSuchColumnsException when columns have not been found
int dbColIndex = tableMetaData.getColumnIndex(columnName);
// If we get here the column exists in the database
Column dbColumn = tableMetaData.getColumns()[dbColIndex];
columnList.add(dbColumn);
}
return new DefaultTableMetaData(tableMetaData.getTableName(),
(Column[])columnList.toArray(new Column[0]),