Skip to main content

H2

Use JdbcTemplate, method annotations, Mapper files, or the Builder API with H2. The following pages cover database-specific configuration and usage.

ScenarioUsage
Key generationIDENTITY and sequences
PaginationLIMIT / OFFSET
Insert conflictsMERGE

For an in-memory database, use jdbc:h2:mem:demo;DB_CLOSE_DELAY=-1. This keeps its data until the JVM exits. See Core API for common operations.