DbSchema lets you design, manage, and document H2 databases. Create ER diagrams, define tables and columns, and generate SQL scripts - with or without a live database connection.
Use Git to share the design, compare it with the H2 database, and deploy changes. DbSchema also includes a data editor, query builder, and HTML5 documentation - everything you need in one tool.
Download DbSchema Download H2 JDBC Driver
H2 is a pure-Java relational database that runs in-process, making it the default embedded database in Spring Boot and a mainstay of Java integration test suites. Because H2 databases often exist only during a test run or are bundled inside an application JAR, schema design and verification are typically done programmatically. DbSchema provides a visual alternative: connect to an H2 file, in-memory, or server-mode database and use a graphical table editor instead of writing DDL by hand.
DbSchema can open an H2 file-based database directly, without requiring the owning application to be active. This disconnected mode lets you inspect and modify the schema of a test database between runs — useful when debugging a Flyway migration or verifying the table structure produced by Hibernate auto-DDL.
Add, rename, or drop columns, change data types, set default values, and define foreign key relationships using the table editor. Changes are previewed as DDL before being applied to the H2 database — no need to write ALTER TABLE statements manually for iterative schema work.
H2 databases used as test fixtures need realistic data to exercise business logic thoroughly. DbSchema's data generator fills tables with configurable synthetic values — names, email addresses, dates, numeric ranges, and foreign-key-aware references — so integration tests run against populated schemas rather than empty tables.
H2 supports three connection modes. For a file-based database, use
jdbc:h2:~/test (relative to the user home directory) or an absolute path such as
jdbc:h2:/data/mydb. For an in-memory database shared within the same JVM, use
jdbc:h2:mem:testdb. For server mode, use
jdbc:h2:tcp://host:9092/~/test after starting H2 with
java -cp h2.jar org.h2.tools.Server -tcp. DbSchema bundles the H2 JDBC driver,
so no separate driver download is required for any of these modes.