開發應用時使用記憶體資料庫是很實用的。很友善的一點是,記憶體資料庫不需要提供持久化存儲。 你不需要在應用啟動時做初始化資料庫動作, 也不需要在應用結束時去删除資料。
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<scope>runtime</scope>
</dependency>