public boolean columnExists(DatabaseMetaData dbMetaData,String tableName,String columnName) throws SQLException {
  return (columnExistsCaseSensitive(dbMetaData,tableName,columnName) || columnExistsCaseSensitive(dbMetaData,tableName,columnName.toUpperCase(Locale.US)) || columnExistsCaseSensitive(dbMetaData,tableName,columnName.toLowerCase(Locale.US))|| columnExistsCaseSensitive(dbMetaData,tableName.toUpperCase(Locale.US),columnName)|| columnExistsCaseSensitive(dbMetaData,tableName.toUpperCase(Locale.US),columnName.toUpperCase(Locale.US))|| columnExistsCaseSensitive(dbMetaData,tableName.toUpperCase(Locale.US),columnName.toLowerCase(Locale.US))|| columnExistsCaseSensitive(dbMetaData,tableName.toLowerCase(Locale.US),columnName)|| columnExistsCaseSensitive(dbMetaData,tableName.toLowerCase(Locale.US),columnName.toUpperCase(Locale.US))|| columnExistsCaseSensitive(dbMetaData,tableName.toLowerCase(Locale.US),columnName.toLowerCase(Locale.US)));
}

public boolean columnExists ( DatabaseMetaData dbMetaData , String tableName , String columnName ) throws SQLException { return ( columnExistsCaseSensitive ( dbMetaData , tableName , columnName ) || columnExistsCaseSensitive ( dbMetaData , tableName , columnName . toUpperCase ( Locale . US ) ) || columnExistsCaseSensitive ( dbMetaData , tableName , columnName . toLowerCase ( Locale . US ) ) || columnExistsCaseSensitive ( dbMetaData , tableName . toUpperCase ( Locale . US ) , columnName ) || columnExistsCaseSensitive ( dbMetaData , tableName . toUpperCase ( Locale . US ) , columnName . toUpperCase ( Locale . US ) ) || columnExistsCaseSensitive ( dbMetaData , tableName . toUpperCase ( Locale . US ) , columnName . toLowerCase ( Locale . US ) ) || columnExistsCaseSensitive ( dbMetaData , tableName . toLowerCase ( Locale . US ) , columnName ) || columnExistsCaseSensitive ( dbMetaData , tableName . toLowerCase ( Locale . US ) , columnName . toUpperCase ( Locale . US ) ) || columnExistsCaseSensitive ( dbMetaData , tableName . toLowerCase ( Locale . US ) , columnName . toLowerCase ( Locale . US ) ) ) ; }
checks database metadata to see if a column exists in a table . try upper , lower , and mixedcase , both on the table name and the column name , to see if the column is there .
