Derby 和 DB2 之间的可移植模式

发布于 2024-10-07 01:29:15 字数 100 浏览 0 评论 0原文

我想使用 Derby 作为给定 DB2 数据库的子集,该数据库旨在在大型机中运行。

在设计数据库时,您会给出哪些提示和技巧,以便最多(至少是 DML)介于两个数据库之间?

I'd like to use Derby as a Subset for a given DB2 Database which is meant to run in a Mainframe.

Which tips and tricks would you give when designing the database in order to be at most (at least DML) between the two databases?

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

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

发布评论

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

评论(1

岁月苍老的讽刺 2024-10-14 01:29:15

我猜你的问题中“最多”的意思是“最兼容”?
总的来说,我认为你在德比郡做出了正确的选择。这是我所知道的唯一一个像 DB2 一样强制执行强类型的数据库。我想 Derby 版本的 dual 表被称为 SYSIBM.SYSDUMMY1 并非巧合。

避免 DML 不兼容问题的最佳方法是在应用程序中使用数据库抽象方法。如果您使用 Java,则 HibernatejOOQ提供了这样的选项。如果抽象数据库不适合您,那么我建议您在自动化集成测试中编写大量示例查询。然后,您将针对 Derby 和 DB2 运行该测试,以检查行为是否相同(例如,插入记录、使用 JOIN、嵌套 SELECT 等再次读取记录)。

作为 jOOQ 的开发人员,我可以告诉您,自己编写集成测试将非常棘手,特别是对于 Derby 和DB2! :-)

I'm guessing that by "at most" you meant "most compatible" in your question?
In general, I think you made the right choice with Derby. It is the only database I know of, that enforces such strong typing as DB2 does. I guess it's not a coincidence that the Derby's version of the dual table is called SYSIBM.SYSDUMMY1.

The best way to avoid DML incompatibility problems is by using a means of database abstraction in your application. If you are using Java, then Hibernate or jOOQ provide such options. If abstracting your database is not an option for you, then I recommend you write a big set of example queries in an automated integration test. That test, you will then run against both Derby and DB2, to check that the behaviour will be identical (e.g. insert records, read them again using JOINs, nested SELECTS, etc, etc).

As the developer of jOOQ, I can tell you that writing the integration tests yourself will be quite tricky, especially for Derby and DB2! :-)

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