1. xml이용해보자
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration> <!-- Applictaion에 configuration이 하는역할이다 -->
<environments default="dev"> <!-- configuration을 하기위해서는 environment객체가 필요하다 -->
<environment id="dev">
<!-- JDBC 혹은 MANAGERD 둘중 하나 선택가능(반드시대문자로 작성) -->
<transactionManager type="JDBC"/>
<!-- POOLED 혹은 UNPOOLED 선택가능(반드시 대문자로 작성) -->
<dataSource type="POOLED">
<property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
<property name="username" value="GREEDY"/>
<property name="password" value="GREEDY"/>
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="com/greedy/section02/xmlconfig/mapper.xml"/>
</mappers>
</configuration>
XML
복사