이것저것

[Spring boot] Postgresql 연결

담쏙 2022. 5. 20. 10:52
728x90

Maven 프로젝트를 기준으로 작성

 

1. pom.xml 에 postgresql dependency 추가

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

- intellij 의 경우, spring boot 프로젝트 생성 시 추가 가능

 

2. application.properties 설정

spring.datasource.hikari.maximum-pool-size=4
spring.datasource.url=jdbc:postgresql://db주소:포트번호/접속db이름
spring.datasource.username=db접속id
spring.datasource.password=db접속password

 

'이것저것' 카테고리의 다른 글

Vuejs 시작 명령어  (0) 2022.05.10
클라우드란?  (0) 2022.01.06
Git Hub 프로필 꾸미기  (0) 2021.09.25
[Window 10] 개발자 모드 활성화 하기  (0) 2021.02.22