mybatis.xml单纯mybatis配置文件(java)

tech2023-08-13  98

导包:

<?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> <!-- 主配置文件 --> <properties resource="db.properties"></properties> <!-- 配置环境的默认id为development --> <typeAliases> <package name="cn.itsource.mybatisdao.domain"/> </typeAliases> <environments default="development"> <!-- 当前环境的id为development --> <environment id="development"> <!-- 使用支持事务的jdbc --> <transactionManager type="JDBC" /> <!-- 连接池类型为pooled --> <dataSource type="POOLED"> <!-- 从db.properties获取的四大金刚 --> <property name="driver" value="${driver}" /> <property name="url" value="${url}" /> <property name="username" value="${username}" /> <property name="password" value="${password}" /> </dataSource> </environment> </environments> <!-- 映射 --> <mappers> <mapper resource="cn/itsource/mybatismapper/mapper/EmpMapper.xml" /> </mappers> </configuration>
最新回复(0)