HSQLDB 和 JavaDB 有什么区别?哪一种适合单元测试?

发布于 2024-09-16 08:23:52 字数 65 浏览 11 评论 0原文

您能告诉我 HSQLDB 和 JavaDB 之间的区别吗?假设我只使用标准功能,我应该在单元测试中使用哪一个?谢谢。

Could you tell me the differences between HSQLDB and JavaDB? And which one should I use in unit testing, assuming that I only use standard features? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

溺渁∝ 2024-09-23 08:23:52

HSQLDB 速度更快,因此更适合单元测试。

H2 数据库 甚至更好(在我看来):它与 HSQLDB 一样快,并且支持各种数据库的兼容模式( MySQL、Oracle、...)。因此,如果您将来需要使用数据库特定功能,您仍然可以使用 H2 进行测试。但我的观点有点偏颇(见我的个人资料)。

HSQLDB is faster, therefore it is better suited for unit testing.

The H2 Database is even better (in my view): it's as fast as HSQLDB, and supports compatibility modes for various databases (MySQL, Oracle,...). So if you need to use database specific features in the future, chances are that you can still test it with H2. But my view is a bit biased (see my profile).

请持续率性 2024-09-23 08:23:52

HSQLDB 具有对测试有用但 JavaDB 中不可用的功能。其中包括

  • 数据库脚本和 SQL 文本格式的日志,允许快速检查测试运行
  • 用户定义的 SQL 函数,允许您编写与另一个数据库支持的任何函数的等效项非常简单
  • 非常广泛的 SQL 特性和函数集,例如日期和函数DB2和ORACLE(还有PostgreSQL和MySQL)支持的区间算术以及TO_DATE等函数

BTW,上述功能在H2中不可用(在另一个答案中提到)

HSQLDB has features that are useful for testing and not available in JavaDB. These include

  • database script and log in SQL text format allows quick check of test runs
  • user-defined SQL functions that allow you to write an equivalent to any function supported by another database very simply
  • very extensive set of SQL features and functions, for example date and interval arithmetic as supported by DB2 and ORACLE (also PostgreSQL and MySQL) and functions such as TO_DATE

BTW, the above features are not available in H2 (mentioned in another answer)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文