conf.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://localhost:3306/frame" /> <property name="username" value="root" /> <property name="password" value="111111" /> </dataSource> </environment> </environments> <mappers> <!-- 注册userMapper.xml文件, userMapper.xml位于me.gacl.mapping这个包下,所以resource写成me/gacl/mapping/userMapper.xml--> <mapper resource="me/gacl/domain/userMapper.xml"/> </mappers> </configuration>
对比翻译代码
<?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”> <配置> <环境 default =“development”> <环境 id =“development”> <事务管理器 type =“JDBC”/> <! - 配置数据库连接信息 - > <数据源 type =“POOLED”> <属性 name =“driver” value =“com.mysql.jdbc.Driver”/> <属性 name =“url” value =“jdbc:mysql://localhost:3306/frame”/> <属性 name =“username” value =“root”/> <属性 name =“password” value =“111111”/> </数据源> </环境> </环境> <映射器> <! - 注册userMapper.xml文件,userMapper.xml位于me.gacl.mapping这个包下,所以资源写成我/的GaCl/制图/ userMapper.xml - > <mapper resource =“me/gacl/domain/userMapper.xml”/> </映射器> </配置>