Search code examples
unit-testinghsqldbjavadb

What is the difference between HSQLDB and JavaDB? Which one is suitable for unit testing?


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.


Solution

  • 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)