- 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.
推薦閱讀
- 同步:秩序如何從混沌中涌現
- Building Computer Vision Projects with OpenCV 4 and C++
- 從0到1:數據分析師養成寶典
- Visual Studio 2015 Cookbook(Second Edition)
- 深度剖析Hadoop HDFS
- 大話Oracle Grid:云時代的RAC
- Spark大數據編程實用教程
- 數據挖掘原理與SPSS Clementine應用寶典
- 大數據精準挖掘
- 智慧的云計算
- 深入理解InfluxDB:時序數據庫詳解與實踐
- 智慧城市中的大數據分析技術
- 標簽類目體系:面向業務的數據資產設計方法論
- 大數據計算系統原理、技術與應用
- Arquillian Testing Guide