[h2db]参照専用DBの作り方

  h2database

If the database files are read-only, then the database is read-only as well. It is not possible to create new tables, add or modify data in this database. Only SELECT and CALL statements are allowed.

Features (h2database.com)

ファイルをReadOnlyにするだけでOK。
プログラム側からは Connection.isReadOnly() で判定可能。
CALL READONLY() というSQLコマンドでも制御可能。

ZIPやJARファイルの中のDBファイルも扱える。

When the zip file is created, you can open the database in the zip file using the following database URL:
jdbc:h2:zip:~/data.zip!/test

Features (h2database.com)

LEAVE A COMMENT