官术网_书友最值得收藏!

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:

  1. 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 = 
  1. Start the application by executing ./gradlew clean bootRun from the command line
  2. 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.
主站蜘蛛池模板: 铜梁县| 个旧市| 达州市| 喀什市| 麦盖提县| 略阳县| 柳州市| 南城县| 万全县| 大英县| 三门峡市| 廊坊市| 成都市| 马鞍山市| 达日县| 确山县| 石景山区| 遂宁市| 托克逊县| 邵武市| 永寿县| 尚志市| 嘉义市| 界首市| 阜新| 阳谷县| 古丈县| 定结县| 玉屏| 景东| 乌拉特后旗| 南平市| 洞口县| 德昌县| 醴陵市| 珠海市| 临邑县| 文成县| 铅山县| 枣强县| 独山县|