leponceau.org

Programming And Stuff, You Know The Thing…

Java embedded H2 database cheat sheet

Posted at — Oct 16, 2017

Start internal frontend

mvn dependency:get -Dartifact=com.h2database:h2:1.4.196
java -jar ~/.m2/repository/com/h2database/h2/1.4.196/h2-1.4.196.jar 

Backup

BACKUP TO 'backup.zip'

SQL export/import (incl. DDLs)

Seems also suitable to fully compact/backup the database.

SCRIPT TO 'script.sql'
RUNSCRIPT FROM 'script.sql'

Full compaction

Use SQL export/import.

Bugs