postgresql - 带有spring boot的Postgresql - 每当我启动应用程序时数据库都是空的
问题描述
我正在学习 Spring Boot,我创建了一个简单的应用程序,我在其中连接到 postgresql 数据库并执行简单的插入/更新/删除操作。一切正常,但如果我停止应用程序,我在数据库中添加的行不会保留在数据库中。我必须在某处指定一种提交吗?
这是application.properties
文件:
spring.jpa.database=POSTGRESQL
spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:5432/testdb
spring.datasource.username=postgres
spring.datasource.password=*pass*
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create
解决方案
推荐阅读
- nlp - NLP:解决块中的共指代词
- microsoft-translator - 如何使用 MicrosoftTranslatorWidget 按当前位置语言翻译页面
- java - 在 Java 中读取 little-endian 64 位浮点数
- mysql - Sumif 与来自不同表的日期条件
- html - 在窗口内放大/缩小会导致图像重复
- javascript - 如何使用 Jquery 在 Modal 中调用局部视图
- jquery - 使用 JQuery 在 MVC 中检查时如何获取复选框值?
- hadoop - 无法在 HBase 中获取副本 0 的位置
- processing - 如何在圆加工中创建积分系统?
- r - 已编辑:如何为 PostHoc Tukey 测试和多重比较编写循环