if (dbObjs[0].getDatabaseObjectType() != DatabaseObjectType.TABLE) {
s_log.error("iterateIndexes: selected item isn't a table");
return;
}
ITableInfo tableInfo = (ITableInfo) dbObjs[0];
ISQLConnection conn = _session.getSQLConnection();
SQLDatabaseMetaData metaData = conn.getSQLMetaData();
try {
ResultSetDataSet rsds =
metaData.getIndexInfo(tableInfo, indexColumnIndices, false);
String indexName = "";
while (rsds.next(null)) {
String thisIndexName = (String)rsds.get(0);
if (thisIndexName != null) {
if (!indexName.equals(thisIndexName)) {
listener.indexSpotted(tableInfo,thisIndexName);
indexName = thisIndexName;
}
}
}
}
catch (DataSetException ex) {
s_log.error("Unable to show indices for table "+
tableInfo.getSimpleName(), ex);
// fine, don't show any indexes.
//throw new WrappedSQLException(ex);
}
}