# Using H2 as a Test Database Product with jOOQ

DevFeed: [Using H2 as a Test Database Product with jOOQ](<https://devfeed.tech/articles/using-h2-as-a-test-database-product-with-jooq-28969.md>)

Original publisher: [Read original article](<https://blog.jooq.org/using-h2-as-a-test-database-product/>)

Author: lukaseder

Published: 2022-08-19T07:25:43Z

Content type: tutorial

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [in-memory database](<https://devfeed.tech/topics/in-memory-database.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Java](<https://devfeed.tech/topics/java.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [sql-server](<https://devfeed.tech/topics/sql-server.md>)

Tags: [compatibility-mode](<https://devfeed.tech/tags/compatibility-mode.md>), [database](<https://devfeed.tech/tags/database.md>), [h2](<https://devfeed.tech/tags/h2.md>), [in-memory-database](<https://devfeed.tech/tags/in-memory-database.md>), [integration-testing](<https://devfeed.tech/tags/integration-testing.md>), [java](<https://devfeed.tech/tags/java.md>), [jooq](<https://devfeed.tech/tags/jooq.md>), [jooq-in-use](<https://devfeed.tech/tags/jooq-in-use.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [testcontainers](<https://devfeed.tech/tags/testcontainers.md>), [testing](<https://devfeed.tech/tags/testing.md>), [vendor-agnosticity](<https://devfeed.tech/tags/vendor-agnosticity.md>)

## AI overview

This article explains the trade-offs of using H2 as a test database for Java applications with jOOQ. It shows why SQL that works on H2 may require syntax changes on SQL Server, describes H2 compatibility modes, and notes that jOOQ generates SQL for H2's native dialect rather than its compatibility modes.

## Source excerpt

The H2 database is an immensely popular in-memory database product mostly used by Java developers for testing. If you check out the DB-Engines ranking, it ranks 50th, which is quite impressive, as this rank outperforms products like: CockroachDB Ignite Single Store (previously MemSQL) Interbase (which was forked as Firebird) Ingres (which is a predecessor to ... Continue reading Using H2 as a Test Database Product with jOOQ ->