Java – what are the benefits of defining Tomcat and DB pools in Tomcat in the spring configuration file
•
Java
What are the benefits of defining DB pool in Tomcat and spring configuration files
<Resource name="jdbc/DBCPosPool" auth="Container" type="javax.sql.DataSource" maxActive="30" maxIdle="10" maxWait="10000" validationQuery="SELECT 1" testOnBorrow="true" username="xxx" password="xxx" driverClassName="com.MysqL.jdbc.Driver" url="jdbc:MysqL://abcd.com/test2?autoReconnect=true"/>
Solution
I can think of three benefits
>Your data source can be reused by other Web Applications > your data source can be managed externally, independent of web applications If the data source changes, you never want to redeploy the code In large organizations, developers are usually not the people who manage data sources and content. > Environment specific details You may work in a DTaP environment or similar Data sources may vary depending on your environment (development, production...) You don't want to maintain a separate spring configuration file just for data connectivity
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码