fee-fi-fo-fum
Published 2023. 10. 7. 22:18
postgreSQL + SpringBoot BackEnd🧵
반응형

1. JPA와 postgreSQL 연동 방법

1.1. 라이브러리 설치

JPA와 postGreSQL 라이브러리를 설치한다.

<bash />
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.postgresql:postgresql'

 

1.2. application.yml 설정

<bash />
spring: datasource: url: jdbc:postgresql://localhost:5432/<DB명> username: <PostgreSQL 계정명> password: <비밀번호> driver-class-name: org.postgresql.Driver jpa: show-sql: true database: postgresql hibernate: ddl-auto: update

이렇게 설정을 마치면 사용이 가능하다. postgreSQL도 H2와 같이 테이블명에 "user" 사용이 불가능하다.

그리고 디비 포트를 5432 사용한다.

반응형
profile

fee-fi-fo-fum

@hae02y

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!