mybatis的config文件配置
<?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核心配置文件--> <configuration> <!--引入数据库属性文件--> <properties resource="db.properties"/> <settings> <!--配置log4j日志输出--> <setting name="logImpl" value="LOG4J"/> <!--使用驼峰命名法转换字段--> <setting name= "mapUnderscoreToCamelCase" value="true"/> </settings> <!--environments配置环境组--> <!--default默认环境--> <environments default="development"> <!--environment单个环境--> <environment id="development"> <!--transactionManager配置事务管理器--> <transactionManager type="JDBC"/> <!--配置连接池--> <dataSource type="POOLED"> <property name="driver" value="${driver}"/> <property name="url" value="${url}"/> <property name="username" value="${username}"/> <property name="password" value="${password}"/> </dataSource> </environment> </environments> <!--每一个Mapper.XML都需要在mybatis核心配置文件中注册--> <mappers> <!-- <mapper resource="com/rui/dao/UserMapper.xml"/>--> <package name="com.chen.dao"/> </mappers> </configuration>