Connecting the backend to Postgres

To connect the Place Reviewer backend to the PostgreSQL database we created for it, we must modify our project's application.properties file to contain the necessary properties that are needed to facilitate a database connection with PostgreSQL. Open the project's application.properties file and add the following properties to it:

spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.generate-ddl=true
spring.datasource.url=jdbc:postgresql://localhost:5432/place-reviewer
spring.datasource.driver.class-name=org.postgresql.Driver
spring.datasource.username=<username>

Insert an appropriate username where the <username> property is within the preceding code snippet. Having added the appropriate database connection properties, Spring Boot will be able to connect to the specified database upon the application start. Having set up the appropriate database connection properties for our project, let us create models for the User and Review entities we earlier identified.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.152.198