aldrinleal
aldrinleal

Reputation: 3609

Portable Schema Between Derby and DB2

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?

Upvotes: 1

Views: 738

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220842

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! :-)

Upvotes: 3

Related Questions