美文网首页
spring配置文件中 destroy-method="

spring配置文件中 destroy-method="

作者: 小知大知 | 来源:发表于2018-05-19 17:12 被阅读23次

spring中配置如下:

<bean id="datasource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">

</bean>

该语句的原意为将BasicDataSource这个类中的destroy方法设置为关闭,即不销毁;
所以可以理解为
当数据库连接不使用的时候,就把该连接重新放到数据池中,方便下次使用调用.

相关文章

网友评论

      本文标题:spring配置文件中 destroy-method="

      本文链接:https://www.haomeiwen.com/subject/rgkadftx.html