属性(property)

Exisi 2021-03-27 07:10:00
Categories: Tags:

示例

<properties resource="org/mybatis/example/config.properties">

<property name="username" value="dev_user"/>
<property
name="password" value="F2Fa3!33TYyg"/>

</properties>

 

示例

<dataSource type="POOLED">

<property name="driver" value="${driver}"/>
<property
name="url" value="${url}"/>
<property
name="username" value="${username}"/>
<property
name="password" value="${password}"/>

</dataSource>

 

username password 将会由 properties 元素中设置的相应值来替换。

driver url 属性将会由 config.properties 文件中对应的值来替换

 

来自 <https://mybatis.org/mybatis-3/zh/configuration.html#environments>