H2
Use JdbcTemplate, method annotations, Mapper files, or the Builder API with H2. The following pages cover database-specific configuration and usage.
| Scenario | Usage |
|---|---|
| Key generation | IDENTITY and sequences |
| Pagination | LIMIT / OFFSET |
| Insert conflicts | MERGE |
- Programmatic API: queries, writes, multiple results, and stored routine differences.
- Mapper API: annotations, Mapper reads and writes, and execution differences.
- Builder API: Supported operations, datasource-specific behavior, and usage.
- Pagination: Page queries and total counts.
- Insert Conflicts: Handle existing records during insertion.
- Key Generation: Configure and retrieve IDs.
- Type Support: Choose Java property types.
- Transaction Support: Roll back multiple writes on failure.
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.