Spring PostgreSQL Support: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=Configuration= | =<span id='Configuration'></span>Spring Configuration= | ||
<syntaxhighlight lang=''> | |||
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres | |||
spring.datasource.username=something | |||
spring.datasource.password=somethingelse | |||
</syntaxhighlight> | |||
If using [[Spring_Boot_Concepts#Spring_Boot_Database_Initialization|Spring Boot Database Initialization]] and Postgres-specific DDL and DML, create schema-postgres.sql, data-postgres.sql files and configure the "plaform" as: | If using [[Spring_Boot_Concepts#Spring_Boot_Database_Initialization|Spring Boot Database Initialization]] and Postgres-specific DDL and DML, create schema-postgres.sql, data-postgres.sql files and configure the "plaform" as: |
Revision as of 05:29, 19 October 2018
External
Internal
Overview
Dependencies
dependencies {
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
runtimeOnly('org.postgresql:postgresql')
}
Spring Configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=something
spring.datasource.password=somethingelse
If using Spring Boot Database Initialization and Postgres-specific DDL and DML, create schema-postgres.sql, data-postgres.sql files and configure the "plaform" as:
spring.datasource.platform=postgres
More details available here: