Database application.yml for Spring boot from applications.properties

前端 未结 3 1368
萌比男神i
萌比男神i 2020-12-06 16:19

I\'ve got a working Spring Boot Application that connects to a Postgres database. I\'ve got the project set up with an application.properties file, but would like to make th

3条回答
  •  难免孤独
    2020-12-06 17:01

    application.yml file for postgresql

    Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)

    spring:
      datasource:
        driver-class-name: org.postgresql.Driver
        username: postgres
        password: root
        url: jdbc:postgresql://localhost/postgres
        platform: postgres
        initialization-mode: always
        continue-on-error: true
      jpa:
        show-sql: true
        generate-ddl: true
        hibernate:
          ddl-auto: create
        database: postgresql
    

提交回复
热议问题