H2 Database Engine

H2 Database Engine

Lightweight embeddable Java database

Description

For a small Java project or a test suite, all you want is somewhere to keep data with SQL. Instead you install MySQL or PostgreSQL, create users, configure ports, and clean the database after every test run.

H2 is an open-source database written in pure Java, and the whole engine is a jar of a few megabytes. It runs embedded inside your application, can switch to server mode for multiple clients, and can live entirely in memory so the data disappears when tests finish, which makes it ideal for unit tests and prototypes.

It ships with the browser-based H2 Console for connecting, writing SQL and viewing results. It speaks standard SQL and JDBC and offers compatibility modes for MySQL, PostgreSQL and others, so switching over is painless. It's free and open source, with a Windows installer and a cross-platform zip.

Features



Three ways to run: embedded, server mode or pure in-memory, all from the same jar.

Web console: H2 Console gives you a schema tree, SQL editor and result grid in the browser, with no separate client.

Standard SQL and JDBC: transactions, views, triggers and stored procedures, plugged into Java apps via JDBC.

Compatibility modes: emulates MySQL, PostgreSQL, Oracle and other dialects, handy as a stand-in for the real database in tests.

Small and fast: the whole database is one jar that starts quickly and uses few resources.

Encryption and full-text search: encrypted database files and built-in full-text search.