1 MyBatis

2 스프링과의 연동 처리

3 log4jdbc-log4j2 설정

Untitled

라이브러리 추가

pom.xml

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

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

Untitled

root-context.xml

<bean id="sqlSessionFactory"
		class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource"></property>
	</bean>

Untitled