How to use a path relative to project root to H2 db-file configuration with Play Framework 2.4?

后端 未结 2 833
无人共我
无人共我 2020-12-24 01:35

We\'re developing a Play 2.4 application (Java API).

For dev purposes, we\'d like to use a persistent H2 database with DB file path relative to the project root dire

2条回答
  •  没有蜡笔的小新
    2020-12-24 02:13

    Ok, I did a little research and found this in the changelog (http://www.h2database.com/html/changelog.html):

    Implicit relative paths are disabled (system property "h2.implicitRelativePath"), so that the database URL jdbc:h2:test now needs to be written as jdbc:h2:./test.

    In H2 starting from version 1.4.177 Beta, implicit relative paths are not allowed anymore. Therefore, in your case the url should be written with a explicit relative path: db.default.url="jdbc:h2:./data/db".

提交回复
热议问题