【发布时间】:2012-05-22 02:53:51
【问题描述】:
我目前正在使用Schemacrawler 收集有关各种数据库的信息。
我遇到的问题是运行应用程序的用户无法访问每个数据库。如果我尝试检索模式列表:
SchemaCrawlerOptions schemaCrawlerOptions = new SchemaCrawlerOptions();
schemaCrawlerOptions.setSchemaInfoLevel(SchemaInfoLevel.minimum());
schemaCrawlerOptions.setTableTypes(new TableType[] { TableType.table });
Database database = SchemaCrawlerUtility.getDatabase(connection, schemaCrawlerOptions);
database.getSchemas()
... 引发 SchemaCrawlerException(服务器主体“...”在当前安全上下文下无法访问数据库“...”。)。有没有办法只获取可访问的数据库(无需显式声明每个架构名称)?
【问题讨论】:
标签: java database schema database-metadata schemacrawler