OCDocumentMetadataObject dmo = documentCollection
.find(tableNamePattern);
if (dmo != null) { // а вдруг если схема не задана объект ей не
// принадлежит
OCMetadataAttributeCollection attributeCollection = dmo
.getAttributes();
attribute2resultSet(attributeCollection, lrs,
SCHEMA_DOCUMENT, tableNamePattern);
int colSZ = attributeCollection.size();
// Add NUMBER
lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
SCHEMA_DOCUMENT, // TABLE_SCHEM
tableNamePattern, // TABLE_NAME
"Number", // COLUMN_NAME
Types.VARCHAR, // DATA_TYPE
"VARCHAR", // TYPE_NAME
Integer.valueOf(dmo.getNumberLength()), // COLUMN_SIZE
null, // BUFFER_LENGTH
null, // DECIMAL_DIGITS
Integer.valueOf(10), // NUM_PREC_RADIX
Integer.valueOf(columnNullableUnknown), // NULLABLE
null, // REMARKS
null, // COLUMN_DEF
null, // SQL_DATA_TYPE
null, // SQL_DATETIME_SUB
Integer.valueOf(dmo.getNumberLength()), // CHAR_OCTET_LENGTH
colSZ + 1, // ORDINAL_POSITION
"", // IS_NULLABLE
null, // SCOPE_CATLOG
null, // SCOPE_SCHEMA
null, // SCOPE_TABLE
null, // SOURCE_DATA_TYPE
"YES" // IS_AUTOINCREMENT
});
// Add DATE
lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
SCHEMA_DOCUMENT, // TABLE_SCHEM
tableNamePattern, // TABLE_NAME
"Date", // COLUMN_NAME
Types.TIMESTAMP, // DATA_TYPE
"TIMESTAMP", // TYPE_NAME
null, // COLUMN_SIZE
null, // BUFFER_LENGTH
null, // DECIMAL_DIGITS
Integer.valueOf(10), // NUM_PREC_RADIX
Integer.valueOf(columnNullableUnknown), // NULLABLE
null, // REMARKS
null, // COLUMN_DEF
null, // SQL_DATA_TYPE
null, // SQL_DATETIME_SUB
null, // CHAR_OCTET_LENGTH
colSZ + 2, // ORDINAL_POSITION
"", // IS_NULLABLE
null, // SCOPE_CATLOG
null, // SCOPE_SCHEMA
null, // SCOPE_TABLE
null, // SOURCE_DATA_TYPE
"NO" // IS_AUTOINCREMENT
});
// Add Posted
lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
SCHEMA_DOCUMENT, // TABLE_SCHEM
tableNamePattern, // TABLE_NAME
"Posted", // COLUMN_NAME
Types.SMALLINT, // DATA_TYPE
"SMALLINT", // TYPE_NAME
null, // COLUMN_SIZE
null, // BUFFER_LENGTH
null, // DECIMAL_DIGITS
Integer.valueOf(10), // NUM_PREC_RADIX
Integer.valueOf(columnNullableUnknown), // NULLABLE
null, // REMARKS
null, // COLUMN_DEF
null, // SQL_DATA_TYPE
null, // SQL_DATETIME_SUB
null, // CHAR_OCTET_LENGTH
colSZ + 3, // ORDINAL_POSITION
"", // IS_NULLABLE
null, // SCOPE_CATLOG
null, // SCOPE_SCHEMA
null, // SCOPE_TABLE
null, // SOURCE_DATA_TYPE
"NO" // IS_AUTOINCREMENT
});
// Add DeletionMark
lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
SCHEMA_DOCUMENT, // TABLE_SCHEM
tableNamePattern, // TABLE_NAME
"DeletionMark", // COLUMN_NAME
Types.SMALLINT, // DATA_TYPE
"SMALLINT", // TYPE_NAME
null, // COLUMN_SIZE
null, // BUFFER_LENGTH
null, // DECIMAL_DIGITS
Integer.valueOf(10), // NUM_PREC_RADIX
Integer.valueOf(columnNullableUnknown), // NULLABLE
null, // REMARKS
null, // COLUMN_DEF
null, // SQL_DATA_TYPE
null, // SQL_DATETIME_SUB
null, // CHAR_OCTET_LENGTH
colSZ + 4, // ORDINAL_POSITION
"", // IS_NULLABLE
null, // SCOPE_CATLOG
null, // SCOPE_SCHEMA
null, // SCOPE_TABLE
null, // SOURCE_DATA_TYPE
"NO" // IS_AUTOINCREMENT
});
}
}
if (schemaPattern == null || schemaPattern.equals(SCHEMA_CATALOG)) {
OCMetadataCatalogCollection catalogCollection = metadata
.getCatalogs();
OCCatalogMetadataObject cmo = catalogCollection
.find(tableNamePattern);
if (cmo != null) {
OCMetadataAttributeCollection mac = cmo.getAttributes();
attribute2resultSet(mac, lrs, SCHEMA_CATALOG,
tableNamePattern);
int colSZ = catalogCollection.size();