Mybatis本置文件mybatis-config.xml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| <?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="jdbc.properties"></properties> <settings> <setting name="logImpl" value="LOG4J"/> </settings>
<typeAliases> <package name="com.mybatis.domain" /> </typeAliases>
<environments default="dev"> <environment id="dev"> <transactionManager type="JDBC" /> <dataSource type="POOLED"> <property name="driver" value="${jdbc.driver}" /> <property name="url" value="${jdbc.url.dev}" /> <property name="username" value="${jdbc.username.dev}" /> <property name="password" value="${jdbc.password.dev}" /> </dataSource> </environment> <environment id="prod"> <transactionManager type="JDBC" /> <dataSource type="POOLED"> <property name="driver" value="${jdbc.driver}" /> <property name="url" value="${jdbc.url.prod}" /> <property name="username" value="${jdbc.username.prod}" /> <property name="password" value="${jdbc.password.prod}" /> </dataSource> </environment> </environments>
<mappers> <package name="com.mybatis.dao" /> </mappers> </configuration>
|