본문 바로가기
카테고리 없음

[스터디] 스프링 부트 개념과 활용 - 7주차 ( ~ 4/10)

by shakevan 2022. 4. 10.

스프링 데이터

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#data

 

Spring Boot Reference Documentation

This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe

docs.spring.io

SQL vs NoSQL

 

인메모리 데이터베이스

1. H2

2. HSQL

3. Derby

 

Spring boot에서는 spring-boot-stater-jdbc설정을 추가해주게되면 autoconfiguration을 통해 아무런 datasource설정 없이 in-memory database를 사용가능하게 지원해줌

 

h2 콘솔 사용법

1. spring-boot-devtools사용

2. spring.h2.console.enabled = true 선언

 - h2콘솔의 기본적인 설정정보는 H2ConsoleProperties에 있음

 

 

 

DBCP(database connection pool)

 

Spring boot는 기본적으로 HikariCP 사용

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#data.sql.datasource.connection-pool

 

Spring Boot Reference Documentation

This section goes into more detail about how you should use Spring Boot. It covers topics such as build systems, auto-configuration, and how to run your applications. We also cover some Spring Boot best practices. Although there is nothing particularly spe

docs.spring.io

아래와 같은 것들을 설정할 수 있음

 

 

Spring boot에 Mysql 연결하기

0. Mysql 설치(docker-compose 링크 추가)

1. mysql-connector 의존성 추가

2. datasource 설정

 

Spring boot PostgreSQL연결하기

0. PostgreSQL 설치(docker-compose 링크 추가)

1. 의존성 추가

2. datasource 설정

댓글