Configuration Druiddatasource Reference (Com.alibaba.druid.pool.DruidDataSource)

Source: Internet
Author: User

  <BeanID= "DataSource"class= "Com.alibaba.druid.pool.DruidDataSource"Init-method= "Init"Destroy-method= "Close">       <!--Basic Property URL, user, password -      < Propertyname= "url"value= "${jdbc_url}" />      < Propertyname= "username"value= "${jdbc_user}" />      < Propertyname= "Password"value= "${jdbc_password}" />      <!--Configure initialization size, minimum, maximum -      < Propertyname= "InitialSize"value= "1" />      < Propertyname= "Minidle"value= "1" />       < Propertyname= "Maxactive"value= " the" />      <!--Configure the time to get the connection wait timeout -      < Propertyname= "Maxwait"value= "60000" />      <!--How often the configuration interval is detected to detect idle connections that need to be closed, in milliseconds -      < Propertyname= "Timebetweenevictionrunsmillis"value= "60000" />      <!--configures the minimum lifetime of a connection in a pool, in milliseconds -      < Propertyname= "Minevictableidletimemillis"value= "300000" />      < Propertyname= "Validationquery"value= "Select ' X '" />      < Propertyname= "Testwhileidle"value= "true" />      < Propertyname= "Testonborrow"value= "false" />      < Propertyname= "Testonreturn"value= "false" />      <!--open Pscache, and specify the size of Pscache on each connection -      < Propertyname= "Poolpreparedstatements"value= "true" />      < Propertyname= "Maxpoolpreparedstatementperconnectionsize"value= " the" />      <!--Configuring filters for monitoring statistics interception -      < Propertyname= "Filters"value= "Stat" />   </Bean>

In general, you only need to configure URLs, username, password, and maxactive (the maximum number of connections).

Ps:

If Oracle is used, configuring poolpreparedstatements to True,mysql can be configured to False. A database with more sub-tables is recommended to be configured as false.

Configuration Druiddatasource Reference (Com.alibaba.druid.pool.DruidDataSource)

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.