}
public ResultSet getColumns(String catalog, String schemaPattern,
String tableNamePattern, String columnNamePattern)
throws SQLException {
OCApp app = connection.getApplication();
// LOG.info("catalog: "+catalog);
// LOG.info("schemaPattern: "+schemaPattern);
// LOG.info("tableNamePattern : "+tableNamePattern);
// LOG.info("columnNamePattern: "+columnNamePattern);
LocalResultSet lrs = LocalResultSet.createEmptyResultSet(new String[] {
"TABLE_CAT",
"TABLE_SCHEM",
"TABLE_NAME",
"COLUMN_NAME",
"DATA_TYPE", // java.sql.Types
"TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS",
"NUM_PREC_RADIX",
"NULLABLE",
"REMARKS",
"COLUMN_DEF",
"SQL_DATA_TYPE", // unused
"SQL_DATETIME_SUB", // unused
"CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE",
"SCOPE_CATLOG", "SCOPE_SCHEMA", "SCOPE_TABLE",
"SOURCE_DATA_TYPE", "IS_AUTOINCREMENT" }, connection);
try {
OCConfigurationMetadataObject metadata = app.getMetadata();
if (schemaPattern == null || schemaPattern.equals(SCHEMA_DOCUMENT)) {
OCMetadataDocumentCollection documentCollection = metadata
.getDocuments();
OCDocumentMetadataObject dmo = documentCollection
.find(tableNamePattern);