
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..

순수 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...