简体   繁体   English

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

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

Before my maven build's integration test phase I start a derby server using the derby-maven-plugin from carlspring, and afterwards I shut it down using the same plugin. 在我的Maven构建的集成测试阶段之前,我使用来自carlspring的derby-maven-plugin启动了derby服务器,然后使用相同的插件将其关闭。

According to Derby's Setting attributes for the database connection URL docs: 根据数据库连接URL文档的Derby的Setting属性

Note: Attributes are not parsed for correctness. 注意:不会解析属性的正确性。 If you pass in an incorrect attribute or corresponding value, it is simply ignored. 如果您输入了错误的属性或相应的值,则将其忽略。

Based on the create=true attribute documentation I created a URL for an in-memory database to run on the network server: 基于create = true属性文档,我为内存数据库创建了URL,以在网络服务器上运行:

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

If incorrect attributes are ignored, how can I check that my tests are running against an in-memory DB on the network server? 如果忽略了错误的属性,如何检查测试是否针对网络服务器上的内存数据库运行?

The derby-maven-plugin keeps it's database on the file system under target/derby . derby-maven-plugin将其数据库保留在文件系统中的target/derby Once the build has finished, you can connect to that database with a JDBC client and check the data yourself. 构建完成后,您可以使用JDBC客户端连接到该数据库并亲自检查数据。

I'm glad to see someone is finding this plugin useful! 我很高兴看到有人发现这个插件有用! Let me know, if you have any other questions, as I'm the main developer of the plugin. 让我知道,如果您还有其他问题,因为我是该插件的主要开发人员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM