If you are not familiar with the Embedded DB JUnit library, consult the GitHub project site for more information.

Starting with the brand new 1.1 release, support for the HyperSQL database engine has been added. As H2 is still the default database engine for the library, you will have to invoke a separate builder to use the HyperSQL engine. Example:

@Rule
public final EmbeddedDatabaseRule databaseRule =
                EmbeddedDatabaseRule.hsqldb()
                                    .withMode(CompatibilityMode.MSSQLServer)
                                    .build();

Requirements

In order to use the HyperSQL support, you must have the following dependencies in your classpath:

  • version 1.1.0 of the embedded-db-junit library
  • at least version 2.4.0 of the HyperSQL library

For the lazy programmer, add these to your Maven POM:

<dependency>
  <groupId>org.zapodot</groupId>
  <artifactId>embedded-db-junit</artifactId>
  <version>1.1.0</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.hsqldb</groupId>
  <artifactId>hsqldb</artifactId>
  <version>2.4.0</version>
  <scope>test</scope>
</dependency>

Compatibility mode

The HyperSQL engine offers a great deal more vendor-specific SQL extensions than the H2 and may be a good option if you need to instantiate the in-memory database with a lot of predefined vendor-specific DDL. To find the level of support for your chosen database engine, please consult the HyperSQL compatibility overview.

Feedback

Do you have any questions or suggestions, please report an issue :-).