.2导入jar包
从mybatis管网下载(地址:https://github.com/mybatis/mybatis-3/releases)
mybatis-3.2..pdf---操作手册
mybatis-3.2..jar--核心 jar包
依赖的jar包


.4由于导入了log4j的jar包,所以要加入log4j.properties(公用文件)
# Global logging configuration,建议开发环境中要用debug
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
SqlMapConfig.xml(公用文件)
通过SqlMapConfig.xml加载mybatis运行环境。

package cn.itcast.mybatis.po;
import java.util.Date;
public class User {
private int id;
private String username;// 用户姓名
private String sex;// 性别
private Date birthday;// 生日
private String address;// 地址
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
User.xml(重点)
建议命名规则:表名+mapper.xml
早期ibatis命名规则:表名.xml


