IndexColumn ic = new IndexColumn(); ic.setName( column ); index.addIndexColumn( ic );
if ( index != null ) { IndexColumn ic = new IndexColumn(); ic.setName( column ); index.addIndexColumn( ic ); }
    private List getIndexesForTable(String tableName) throws SQLException {        DatabaseMetaData dbmd = connection.getMetaData();        Map indexesByName = new HashMap();        ResultSet columnData = null;        try {            columnData = dbmd.getIndexInfo(catalog, schema, tableName, false, false);        } catch ( SQLException e ) {            log.trace("database does not support getIndexInfo()", e);        }        if ( columnData != null ) {            try {                //can be multiple columns per index                while ( columnData.next() ) {                    String indexName = columnData.getString("INDEX_NAME");                    boolean unique = !columnData.getBoolean("NON_UNIQUE");                    String column = columnData.getString("COLUMN_NAME");                    Index index = (Index) indexesByName.get(indexName);                    if ( index == null ) {                        index = new Index();                        index.setName( indexName );                        indexesByName.put( indexName, index );                        index.setUnique( unique );                    }                    IndexColumn ic = new IndexColumn();                    ic.setName( column );                    index.addIndexColumn( ic );                }            }            finally {                if (columnData != null) {                    columnData.close();                }            }        }        return new Vector(indexesByName.values());    }