MyEclipse xml 手动添加 dtd
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.mycom.mybatis_1.test1.userMapper"> <!-- 根据id查询,得到一个user对象 --> <select id="getUser" parameterType="int" resultType="com.mycom.mybatis_1.test1.User"> select * from users where id=#{id} </select> </mapper>