- Spring Boot 2.0 Cookbook(Second Edition)
- Alex Antonov
- 109字
- 2021-06-24 19:24:38
How to do it...
Let's change the defaults in order to create an embedded H2 database that will not store data in-memory, but rather use a file to persist the data among application restarts, by performing the following steps:
- Open the file named application.properties under the src/main/resources directory from the root of our project and add the following content:
spring.datasource.url = jdbc:h2:~/test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE spring.datasource.username = sa spring.datasource.password =
- Start the application by executing ./gradlew clean bootRun from the command line
- Check your home directory, and you should see the following file in there: test.mv.db
The user home directory is located under /home/<username> on Linux and under /Users/<username> on macOS X.
推薦閱讀
- SQL入門經典(第5版)
- Developing Mobile Games with Moai SDK
- Oracle RAC 11g實戰指南
- 數據庫開發實踐案例
- 跟老男孩學Linux運維:MySQL入門與提高實踐
- 數據中心數字孿生應用實踐
- Hadoop大數據開發案例教程與項目實戰(在線實驗+在線自測)
- 區塊鏈技術應用與實踐案例
- 深入理解InfluxDB:時序數據庫詳解與實踐
- 中文版Access 2007實例與操作
- Access 2010數據庫程序設計實踐教程
- Applying Math with Python
- Learning Game AI Programming with Lua
- Swift 2 By Example
- 創新求索錄:第二集(精裝版)