Developer/Spring (2) 썸네일형 리스트형 Spring boot와 PostgreSQL 연결하기 Spring boot 와 PostgreSQL 을 연결해보려 한다PostgreSQL 드라이버 추가# build.gradle 파일 수정runtimeOnly 'org.postgresql:postgresql'properties에 PostgreSQL 연결 설정을 추가한다# application.properties 파일 수정# PostgreSQL Database Configurationspring.datasource.url=jdbc:postgresql://localhost:5432/[Database명]spring.datasource.username=[username]spring.datasource.password=[password]spring.datasource.driver-class-name=org.postgre.. 그래들로 스프링부트 시작하기 그래들을 이용하여 스프링 부트 프로젝트를 생성 후,서버가 잘 떠있는지&정상적으로 호출이 되는지 확인하고자함API 호출 테스트를 위한 Controller 추가import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublic class HelloController { @GetMapping("/hello") public String hello() { return "Hello! 서버가 정상적으로 작동하고 있습니다! 🚀"; } @GetMapping("/health") public Stri.. 이전 1 다음