YOONJI
article thumbnail
[Spring Intro] Section 06. 스프링 DB 접근 기술_JPA, 스프링 데이터 JPA
🖋️ study/spring 2023. 1. 30. 21:13

JPA JPA는 기존의 반복 코드는 물론이고, 기본적인 SQL도 JPA가 직접 만들어서 실행해준다. JPA를 사용하면, SQL과 데이터 중심의 설계에서 객체 중심의 설계로 패러다임을 전환을 할 수 있다. JPA를 사용하면 개발 생산성을 크게 높일 수 있다. build.gradle 파일에 JPA, h2 데이터베이스 관련 라이브러리 추가 dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' //implementation 'org.springframework.boot:spring-boot-st..

article thumbnail
[Spring Intro] Section 06. 스프링 DB 접근 기술_순수 JDBC, 스프링 통합 테스트, 스프링 JDBC Template
🖋️ study/spring 2023. 1. 30. 04:40

순수 JDBC 환경 설정 # build.gradle 파일에 jdbc, h2 데이터베이스 관련 라이브러리 추가 // DB와 연동하기 위해 필요한 드라이버 implementation 'org.springframework.boot:spring-boot-starter-jdbc' // DB와 붙을 때 필요한 데이터베이스가 제공하는 클라이언트 runtimeOnly 'com.h2database:h2' # 스프링 부트 데이터베이스 연결 설정 추가 resources/application.properties spring.datasource.url=jdbc:h2:tcp://localhost/~/test spring.datasource.driver-class-name=org.h2.Driver spring.datasource...