<!--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