Spring database Chain connection Pooling configuration properties (Druid) __java

Source: Internet
Author: User
Tags connection pooling
<!--Configure Data source--> <!--Load Database configuration file jdbc.properties detailed in the last--> <context:property-placeholder location= "Clas Spath:jdbc.properties "/> <bean id= dataSource" class= "Com.alibaba.druid.pool.DruidDataSource" Init-meth Od= "Init" destroy-method= "Close" > <!--basic property driver URL, user, password--> <property name= "DRIVERCL Assname "value=" ${jdbc.driverclassname} "></property> <property name=" url "value=" ${jdbc.url} "></ property> <property name= "username" value= "${jdbc.username}" ></property> <property name= "Password" value= "${jdbc.password}" ></property> <!--Configure initialization size, MIN, max--> <property name= "I Nitialsize "value=" 1 "/> <property name=" Minidle "value=" 1 "/> <property name=" maxactive "Valu e=/> <!--Configure the time to get the connection wait timeout--> <property name= "maxwait" value= "60000"/> <!-- How often does the configuration interval be tested to detect idle links that need to be closedNext, the unit is millisecond--> <property name= "Timebetweenevictionrunsmillis" value= "60000"/> <!--Configure a connection to minimize survival in the pool The time unit is milliseconds--> <property name= "Minevictableidletimemillis" value= "300000"/> <property name= "va Lidationquery "value=" select ' X ' "/> <property name=" Testwhileidle "value=" true "/> Name= "Testonborrow" value= "false"/> <property name= "Testonreturn" value= "false"/> <!--Open PSC  Ache, and specifies the size of the Pscache on each connection--> <property name= "poolpreparedstatements" value= "true"/>
        Name= "maxpoolpreparedstatementperconnectionsize" value= "/> <!--Configuration Monitoring statistical interception filters--> <property name= "Filters" value= "Wall,stat"/> </bean> <!--load JDBC profile--! > Reference http://blog.csdn
 . net/rickesy/article/details/50791534
Spring configuration file <context:property-placeholder> tag usage talking about <context:property-placeholder
location= "" file-encoding= "" ignore-resource-not-found= "" ignore-unresolvable= "" p roperties-ref= "" Local-override= "" system-properties-mode= "" order= ""/>Location:Represents the location of the property file, separated by multiple, such as commas/semicolons;file-encoding:File encoding;Ignore-resource-not-found:If the property file is not found, is ignored, default false, that is not ignored, will throw an exceptionignore-unresolvable:Whether to ignore unresolved properties, if not ignored, will throw an exceptionProperties-ref:Local java.util.Properties ConfigurationLocal-override:Whether the local overwrite mode, that is, if true, then the Properties-ref property overrides the location loaded propertySystem-properties-mode:System attribute mode, Environment (default), Never,overrideEnvironment:will use the propertysourcesplaceholderconfigurer provided by spring 3.1, others using the Propertyplaceholderconfigurer before spring 3.1OVERRIDE:Propertyplaceholderconfigurer is used because the version is not enviroment before spring 3.1, so override is the previous version of Spring 3.1 environmentNEVER:Find only properties-ref, location;Order :Find order when multiple <context:property-placeholder/> is configured



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.