schemacrawler java.lang.NullPointerException:无法检索目录
我尝试将 schemacrawler 与 hsqldb 2.51 和 h2 2.x 一起使用,代码如下:
final LimitOptionsBuilder limit = LimitOptionsBuilder.builder()
.includeSchemas(new IncludeAll())
.includeTables(new IncludeAll());
final LoadOptionsBuilder load = LoadOptionsBuilder.builder()
.withSchemaInfoLevel(SchemaInfoLevelBuilder.minimum());
final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions()
.withLimitOptions(limit.toOptions())
.withLoadOptions(load.toOptions());
final Catalog catalog = SchemaCrawlerUtility.getCatalog(connection, options);
// throw NullPointerException
for (final schemacrawler.schema.Table t : catalog.getTables())
{
//more code...
}
我无法在没有 NullPointerException 错误的情况下获取目录。 我的类路径中有两个档案:
- schemacrawler-16.16.11.jar
- schemacrawler-hsqldb-16.16.11.jar
如果有人有想法......
I try to use schemacrawler with hsqldb 2.51 and h2 2.x with the following code:
final LimitOptionsBuilder limit = LimitOptionsBuilder.builder()
.includeSchemas(new IncludeAll())
.includeTables(new IncludeAll());
final LoadOptionsBuilder load = LoadOptionsBuilder.builder()
.withSchemaInfoLevel(SchemaInfoLevelBuilder.minimum());
final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions()
.withLimitOptions(limit.toOptions())
.withLoadOptions(load.toOptions());
final Catalog catalog = SchemaCrawlerUtility.getCatalog(connection, options);
// throw NullPointerException
for (final schemacrawler.schema.Table t : catalog.getTables())
{
//more code...
}
I can't get the catalog without an NullPointerException error.
I have two archives in the classpath:
- schemacrawler-16.16.11.jar
- schemacrawler-hsqldb-16.16.11.jar
If someone has an idea...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更改一些代码后,我设法得到了一些有用的东西...
但是,第一个代码总是给我同样的错误...
After changing some code I managed to have something that works...
However, the first code always gives me the same error...