반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Engineer
- container
- 초간단파이썬
- 도커
- RSS
- httpd실행
- 쿠버네티스
- Kubernetes
- devops #jenkins
- namespace
- Strimzi
- ioredirection
- mongodb operator
- java
- docker
- nginx
- 컨테이너
- bash
- multivm
- springboot
- DOIK
- linux
- devops #engineer
- Vagrant
- 파이썬
- aws #engineer
- WEB
- python
- variable
- k8s
Archives
- Today
- Total
샤인의 IT (막 적는) 메모장
[JAVA] Springboot postgresql 연동 본문
반응형
postgresql 연동
postgresql 설치
https://www.postgresql.org/download/windows/
DB 설정값은 default!

설치 후 psql 실행

DB 생성
CREATE DATABASE student;
GRANT ALL PRIVILEGES ON DATABASE “<DB명>” TO <User>;
\c <DB명>
\d relation
App으로 돌아와서 프로퍼티 및 디펜던시 파일 수정 후 실행
DB 설정 정보 입력
application.properties
spring.datasource.url=jdbc:postgresql://localhost:5432/student
spring.datasource.username="<User명>"
spring.datasource.password="<비밀번호>"
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
JPA 디펜던시 추가
pom.xml
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
...
참고
https://www.youtube.com/watch?v=9SGDpanrc8U&t=1600s
끝
반응형
'Programming > JAVA' 카테고리의 다른 글
| [JAVA] Springboot JPA (0) | 2022.01.09 |
|---|---|
| [JAVA] Springboot DI(의존성 주입) (0) | 2022.01.02 |
| [JAVA] Springboot Controller(API Layer) 생성 (0) | 2022.01.01 |
| [JAVA] Springboot 정보를 담는 클래스 생성 (0) | 2022.01.01 |
| [JAVA] Springboot AppApplication 실행 (0) | 2022.01.01 |
Comments