Yoon.s

[MyBatis] 스프링에서 mybatis 사용하기 본문

백/Spring

[MyBatis] 스프링에서 mybatis 사용하기

yo_onHJ 2020. 9. 9. 15:13

스프링에서 Mybatis를 사용하려면 라이브러리가 필요합니다. 

Maven를 이용하여 스프링의 라이브러리를 관리하고 있다면 라이브러리를 pom.xml에 추가하기만 하면 됩니다. 

 

1. mvnrepository에 접속

mvnrepository.com/

  • mybatis
  • mybatis-spring

 

2. 해당 라이브러리를 입력

 

 

3. 원하는 버전을 클릭해줍니다. 

 

 

4. Maven 안에 있는 의존성을 복사해줍니다!! 

 

5. 자신의 프로젝트의 pom.xml에 <dependencies></dependencies> 안에 추가 해준다

<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
	<groupId>org.mybatis</groupId>
	<artifactId>mybatis</artifactId>
	<version>3.5.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
<dependency>
	<groupId>org.mybatis</groupId>
	<artifactId>mybatis-spring</artifactId>
	<version>2.0.5</version>
</dependency>

 

Comments