确定 Derby 网络服务器是 运行 文件系统还是内存数据库

Determine whether Derby network server is running a file system or memory database

在我的 Maven 构建的集成测试阶段之前,我使用来自 carlspring 的 derby-maven-plugin 启动了一个德比服务器,然后我使用相同的插件将其关闭。

根据 Derby 的 Setting attributes for the database connection URL 文档:

Note: Attributes are not parsed for correctness. If you pass in an incorrect attribute or corresponding value, it is simply ignored.

根据 create=true attribute 文档,我为内存数据库创建了一个 URL 到网络服务器上的 运行:

jdbc:derby://localhost:1527/memory:tariff;create=true

如果忽略不正确的属性,我如何检查我的测试是否运行针对网络服务器上的内存数据库?

derby-maven-plugin 将其数据库保存在 target/derby 下的文件系统中。构建完成后,您可以使用 JDBC 客户端连接到该数据库并自行检查数据。

很高兴看到有人发现这个插件很有用!如果您有任何其他问题,请告诉我,因为我是该插件的主要开发人员。