运行效果演示-修改applcation-db.xml 文件
生活随笔
收集整理的這篇文章主要介紹了
运行效果演示-修改applcation-db.xml 文件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:tx="http://www.springframework.org/schema/tx"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd"><bean id="datasourcePool" abstract="true" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"><property name="initialSize" value="${dbPool.initialSize}" /><property name="minIdle" value="${dbPool.minIdle}" /><property name="maxActive" value="${dbPool.maxActive}" /><property name="maxWait" value="${dbPool.maxWait}" /><property name="timeBetweenEvictionRunsMillis" value="${dbPool.timeBetweenEvictionRunsMillis}" /><property name="minEvictableIdleTimeMillis" value="${dbPool.minEvictableIdleTimeMillis}" /><property name="validationQuery" value="${dbPool.validationQuery}" /><property name="testWhileIdle" value="${dbPool.testWhileIdle}" /><property name="testOnBorrow" value="${dbPool.testOnBorrow}" /><property name="testOnReturn" value="${dbPool.testOnReturn}" /><property name="poolPreparedStatements" value="${dbPool.poolPreparedStatements}" /><property name="maxPoolPreparedStatementPerConnectionSize" value="${dbPool.maxPoolPreparedStatementPerConnectionSize}" /><property name="filters" value="${dbPool.filters}" /></bean><bean id="dataSource" parent="datasourcePool"><property name="driverClassName" value="${db2019.mysql.jdbc.driverClassName}" /><property name="url" value="${db2019.mysql.jdbc.url}" /><property name="username" value="${db2019.mysql.jdbc.username}" /><property name="password" value="${db2019.mysql.jdbc.password}" /></bean><bean id="dataSource2018" parent="datasourcePool"><property name="driverClassName" value="${db2018.mysql.jdbc.driverClassName}" /><property name="url" value="${db2018.mysql.jdbc.url}" /><property name="username" value="${db2018.mysql.jdbc.username}" /><property name="password" value="${db2018.mysql.jdbc.password}" /></bean><bean id="dynamicDataSourceEntry" class="javax.core.common.jdbc.datasource.DynamicDataSourceEntry" /><bean id="dynamicDataSource" class="javax.core.common.jdbc.datasource.DynamicDataSource" ><property name="dataSourceEntry" ref="dynamicDataSourceEntry"></property><property name="targetDataSources"><map><entry key="DB_2019" value-ref="dataSource"></entry><entry key="DB_2018" value-ref="dataSource2018"></entry></map></property><property name="defaultTargetDataSource" ref="dataSource" /></bean></beans>
?
總結
以上是生活随笔為你收集整理的运行效果演示-修改applcation-db.xml 文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 动态数据源切换的底层原理-Dynamic
- 下一篇: Spring5 版本新特性简述