学习完了hibernate框架后,又花了一天时间简单学习了mybatics,今天做个的简单整理复习。
1.jar包 :相关jar包的导入,包含mysql-connector-java-3.1.12-bin.jar mybatis-3.2.3.jar commons-logging-1.1.1.jar 等。
2.po类 :此处以学生类为例
public class Student implements Serializable{
private Integer id;
private int age;
private String name;
public Student() {
super();
}
public Student(int age, String name) {
super();
this.age = age;
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getAge() {
return age;