必须为元素类型 "mapper" 声明属性 "namespace" 或The content of element type "mapper" must match "EMPTY"
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
- <mapper namespace = "com.introduce.Modle.User2">
- <resultMap type="com.introduce.Model.User2" id="user2ResultMap">
- <result property="name" column="name" />
- <result property="age" column="age" />
- <result property="sex" column="sex" />
- </resultMap>
- <select id="getUser2" resultMap="user2ResultMap">
- <![CDATA[select * from User2 where name=#{name}]]>
- </select>
- </mapper>
只需把<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
这行中的两处config 改成mapper即可