我有一个能够连接到Postgres数据库的Spring Boot应用程序。我已经使用application.properties文件设置了项目,但是我想切换到application.yml文件。但是当我进行切换时,我的应用程序在尝试连接到数据库时出现错误。
原始的application.properties文件:
spring.jpa.database=POSTGRESQL
spring.datasource.platform=postgres
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create-drop
spring.database.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb
spring.datasource.username=foo
spring.datasource.password=bar
这是我在 application.yml 文件中所写的内容:
spring.jpa:
database: POSTGRESQL
hibernate.ddl-auto: create-drop
show-sql: true
spring.datasource:
platform: postgres
driverClassName: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/mydb
username: foo
password: bar
我在文件类型的翻译中有所遗漏吗?