*/
public void fillFromTableSelectDELETED(ResultSet rs, boolean fillData, I_AttributeTransformer transformer) throws Exception {
SqlDescription description = new SqlDescription(this.info);
setDescription(description);
ResultSetMetaData meta = rs.getMetaData();
int numberOfColumns = meta.getColumnCount();
String tableName = null;
String schema = null;
String catalog = null;
for (int i=1; i <= numberOfColumns; i++) {
SqlColumn col = new SqlColumn(this.info);
description.addColumn(col);
tableName = meta.getTableName(i);
if (tableName != null && tableName.length() > 0)
col.setTable(meta.getTableName(i));
schema = meta.getSchemaName(i);
if (schema != null && schema.length() > 0)
col.setSchema(schema);
catalog = meta.getCatalogName(i);
if (catalog != null && catalog.length() > 0)
col.setCatalog(catalog);
col.setType(meta.getColumnTypeName(i));
if (meta.getPrecision(i) > 0)
col.setPrecision(meta.getPrecision(i));
if (meta.getScale(i) > 0)
col.setScale(meta.getScale(i));
// always write this since it is not a boolean and it has no default ...
col.setNullable(meta.isNullable(i));
if (meta.isSigned(i)==false)
col.setSigned(meta.isSigned(i));
if (meta.isReadOnly(i)==true)
col.setReadOnly(meta.isReadOnly(i));
}
// add PK and FK stuff here ...
Statement st = rs.getStatement();
if (st != null) {
Connection conn = st.getConnection();
if (conn != null) {
DatabaseMetaData dbMeta = conn.getMetaData();
ResultSet pkRs = dbMeta.getPrimaryKeys(catalog, schema, tableName);
while (pkRs.next()) {
String colName = pkRs.getString(4);
//String pkName = pkRs.getString(6);
SqlColumn col = description.getColumn(colName);
if (col != null)
col.setPrimaryKey(true);
}
ResultSet fkRs = dbMeta.getImportedKeys(catalog, schema, tableName);
while (fkRs.next()) {
String colName = fkRs.getString(8);
SqlColumn col = description.getColumn(colName);
if (col != null) {
col.setFkCatalog(fkRs.getString(1));
col.setFkSchema(fkRs.getString(2));
col.setFkTable(fkRs.getString(3));
col.setFkCol(fkRs.getString(4));
col.setFkSeq(fkRs.getString(9));
col.setFkUpdRule(fkRs.getString(10));
col.setFkDelRule(fkRs.getString(11));
col.setFkDef(fkRs.getString(14));
}
}
}
}
if (transformer != null) {
Map attr = transformer.transform(rs, -1);
if (attr != null) {
Iterator iter = attr.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
ClientProperty prop = new ClientProperty((String)entry.getKey(), null, null, entry.getValue().toString());
description.setAttribute(prop);
}
}
}
if (fillData) {
int count = 0;
while (rs.next()) {
SqlRow row = new SqlRow(this.info, count);
count++;
getRows().add(row);
for (int i=1; i<=numberOfColumns; i++) {
String value = rs.getString(i);
ClientProperty prop = new ClientProperty(meta.getColumnName(i), null, null, value);
row.setColumn(prop);
}
if (transformer != null) {
Map attr = transformer.transform(rs, count);
if (attr != null) {