How to use a persistent H2 database in the Play Framework instead of in-memory How to use a persistent H2 database in the Play Framework instead of in-memory database database

How to use a persistent H2 database in the Play Framework instead of in-memory


I found the solution.

To create a file database, modify the following:

From

db.default.url="jdbc:h2:mem:play"

To

db.default.url="jdbc:h2:file:data/db"

Where data/db is broken down into:

data/ The folder location of the database files relative to your project root.

db The name of your database files.