Created
February 7, 2015 08:29
-
-
Save cheng470/22927b37ec80568a5eb0 to your computer and use it in GitHub Desktop.
Mybatis 第一个例子优化,优化配置文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driver=com.mysql.jdbc.Driver | |
url=jdbc:mysql://localhost:3306/test | |
username=root | |
password=123456 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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="config.properties"></properties> | |
<!-- 配置别名 --> | |
<typeAliases> | |
<typeAlias type="com.test.bean.User" alias="User"/> | |
</typeAliases> | |
<!-- 配置环境 --> | |
<environments default="development"> | |
<environment id="development"> | |
<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> | |
<!-- 配置映射 --> | |
<mappers> | |
<mapper resource="userMapper.xml"/> | |
</mappers> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment