详解Mybatis(二)与搭建mybatis

一.Ibatis入门程序

1.查询

1-1根据编号查询

      1.编写mapper.xml

详解Mybatis(二)与搭建mybatis

    2.在核心配置文件中加载mapper.xml

详解Mybatis(二)与搭建mybatis

     3.测试

详解Mybatis(二)与搭建mybatis

1-2.模糊查询

  1. 编写mapper.xml

详解Mybatis(二)与搭建mybatis

   2.编写测试类

详解Mybatis(二)与搭建mybatis

3.观察log4j

详解Mybatis(二)与搭建mybatis

1-3查询全部

  1. 编写mapper.xml

详解Mybatis(二)与搭建mybatis

2.编写测试类

详解Mybatis(二)与搭建mybatis

3.观察log4j

详解Mybatis(二)与搭建mybatis

2.删除

  1.编写mapper.xml

详解Mybatis(二)与搭建mybatis

    2.编写测试类

详解Mybatis(二)与搭建mybatis

        3.观察log4j

详解Mybatis(二)与搭建mybatis

3.修改

  1.编写mapper.xml

详解Mybatis(二)与搭建mybatis

2.编写测试类

详解Mybatis(二)与搭建mybatis

3.观察log4j

详解Mybatis(二)与搭建mybatis

4.增加

1.编写mapper.xml​​​​​​​

详解Mybatis(二)与搭建mybatis

2.编写测试类

详解Mybatis(二)与搭建mybatis

3.观察log4j

详解Mybatis(二)与搭建mybatis