<?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> <!-- 给bean取别名用在mapping文件中 --> <typeAliases> <typeAlias type="com.lubby.bean.Worker" alias="Worker" /> </typeAliases> <environments default="development"> <environment id="development"> <!-- 使用JDBC的事务管理 --> <transactionManager type="JDBC" /> <!-- 数据源 --> <dataSource type="POOLED"> <property name="driver" value="org.gjt.mm.mysql.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/phonemanage?useUnicode=true&characterEncoding=UTF-8" /> <property name="username" value="root" /> <property name="password" value="toor" /> </dataSource> </environment> </environments> <!-- 这里可以写多个实体的映射文件 --> <mappers> <mapper resource="com/lubby/bean/WorkerSqlMap.xml" /> </mappers> </configuration>