我在我的项目中使用这个Gradle依赖项
implementation group: 'us.fatehi', name: 'schemacrawler', version: '16.16.14'该项目使用Scala语言,DB2是所使用的数据库。
这是我正在使用的scala代码的片段:
val limitOptionsBuilder = LimitOptionsBuilder.builder
.includeSchemas(new RegularExpressionInclusionRule("schema_name"))
.includeTables((tableName: String) => !tableName.contains("table_name_thats_in_the_above_scema"))
val loadOptionsBuilder = LoadOptionsBuilder.builder.withSchemaInfoLevel(SchemaInfoLevelBuilder.standard())
val options = SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions
.withLimitOptions(limitOptionsBuilder.toOptions())
.withLoadOptions(loadOptionsBuilder.toOptions())
var catalog :Catalog = null
catalog = SchemaCrawlerUtility.getCatalog(connection, options)下面是例外情况:
SchemaCrawler database plugin should be on the CLASSPATH for <my_db2_classpath>,
or "SC_WITHOUT_DATABASE_PLUGIN" should be set to the name of the missing plugin
either as an environmental variable or as a Java system property在使用Schemacrawler连接到数据库之前,还需要做其他设置吗?理想情况下,我需要连接到数据库,并以HTML/PDF格式的ER图的形式获取表之间的关系。
发布于 2022-04-28 00:10:45
https://stackoverflow.com/questions/72028609
复制相似问题