去Maven Dependencies中找到mybatis的jar包
D:\apache-maven-3.0.5\work\org\mybatis\mybatis\3.2.8
复制到你想要的目录,解压
D:\dtd\org\apache\ibatis\builder\xml
去builder\xml目录下
如在mybatis-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!--配置开发环境 -->
<environments default="development">
<environment id="development">
<!--事务管理环境 -->
<transactionManager type="JDBC" />
<!--配置数据源 -->
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql:///test" />
<property name="username" value="root" />
<property name="password" value="g" />
</dataSource>
</environment>
</environments>
<mappers>
<mapper resource="mapper/ProductMapper.xml" />
</mappers>
</configuration>
的头中,拷贝
http://mybatis.org/dtd/mybatis-3-config.dtd
选择URI
location选FileSystem
地址D:\dtd\org\apache\ibatis\builder\xml
选择你的mybatis-3-mapper.dtd
同理配置config.dtd如下
网友评论