https://github.com/beyond-sw-camp-08/mariadb/blob/main/16_university%20%EC%8B%A4%EC%8A%B5.sql
: 해당 sql문 실행하여 web 데이터 베이스 내 테이블 및 데이터 추가
[ 결과 ]

🔗 sts4 설치 링크
https://spring.io/tools
🔗 lombok 설치 방법 참고 링크
https://hyuneexpress.tistory.com/entry/macOS-lombok%EB%A1%AC%EB%B3%B5-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-%EB%B0%8F-%EC%84%A4%EC%B9%98
🔗 Spring Initializr
https://start.spring.io/

File -> New -> Spring Starter Project

next> 선택 후 의존성 추가

next> -> Finish
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
-> 여기 있던 scope 삭제!
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>

spring-boot-starter-webspring-boot-starter-testspring-boot-starter-validationspring-boot-starter-actuator spring-boot-starter-jpa # application.yml
server:
port: 8080
# application-dev.yml
spring:
profiles: dev
server:
port: 8088
# application-live.yml
spring:
profiles: live
server:
port: 8089
: Run -> Run Configuration 에서 프로파일 지정 후 사용 가능

java -jar myapp.jar --spring.profiles.active=dev // Application.java
public static void main(String[] args) {
new SpringApplicationBuilder(Application.class).profiles("dev").run(args);
}
// 특정 프로파일에서만 활성화되는 빈을 설정
@Bean
@Profile("dev")
public TestBean testBean() {
return new TestBean();
}
@SpringBootTest
@ActiveProfiles("dev")
public class ApplicationTest {
@Test
void contextLoads() {
}
}
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
...
</html>
<!-- 컨트롤러로 전달받은 Model에 접근할 때는 ${..} 표현법을 사용한다. -->
<span th:text="${message}"></span>
<!-- 링크를 지정할 때는 @{..} 표현법을 사용한다. -->
<a th:href="@{/home}">Home</a>
<form th:action="@{/submit}" method="post">
...
</form>
<input type="text" th:value="${address}"></span>
<span th:if="${name != null}" th:text="${name}"></span>
<ul>
<li th:each="item : ${items}" th:text="${item}"></li>
</ul>