Spring Data JPA – Postgres Configuration

While we develop our applications using Spring Boot, we keep searching these data every time. Here is the required code piece for a fresh start of application with postgres configuration.

spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.url=jdbc:postgresql://IP_ADDRESS:5432/DB_NAME
spring.datasource.username=USERNAME
spring.datasource.password=PASSWORD
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.generate-ddl=true  
spring.jpa.show-sql=true

Here is our maven dependency which does not have version due to our starter pom files.

<dependency>
   <groupId>org.postgresql</groupId>
   <artifactId>postgresql</artifactId>
</dependency>

You may also like...

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x