use of net.sourceforge.squirrel_sql.fw.sql.dbobj.BestRowIdentifier in project tdq-studio-se by Talend.
the class RowIdsTab method getDataSet.
public DataSet getDataSet() throws Exception {
INode node = getNode();
if (node == null) {
return null;
}
if (node instanceof TableNode) {
TableNode tableNode = (TableNode) node;
BestRowIdentifier[] rowIds = node.getSession().getMetaData().getBestRowIdentifier(tableNode.getTableInfo());
Comparable[][] data = new Comparable[rowIds.length][];
int index = 0;
for (BestRowIdentifier rowId : rowIds) {
Comparable[] row = new Comparable[COLUMN_LABELS.length];
data[index++] = row;
int i = 0;
row[i++] = rowId.getScope();
row[i++] = rowId.getColumnName();
row[i++] = rowId.getSQLDataType();
row[i++] = rowId.getTypeName();
row[i++] = rowId.getPrecision();
row[i++] = rowId.getScale();
row[i++] = rowId.getPseudoColumn();
if (i != COLUMN_LABELS.length)
throw new RuntimeException(Messages.getString("RowIdsTab.RuntimeException"));
}
DataSet dataSet = new DataSet(COLUMN_LABELS, data);
return dataSet;
}
return null;
}
Aggregations