Druid Data Source Configuration

Source: Internet
Author: User

<BeanID= "DataSource"class= "Com.alibaba.druid.pool.DruidDataSource"Init-method= "Init"Destroy-method= "Close">< Propertyname= "url"value= "${datasource.url}" />< Propertyname= "username"value= "${datasource.name}" />< Propertyname= "Password"value= "${datasource.password}" />< Propertyname= "ConnectionProperties"value= "Config.decrypt=true" />< Propertyname= "Filters"value= "config,log4j" />< Propertyname= "Maxactive"value= "${datasource.maxactive}" />< Propertyname= "InitialSize"value= "${datasource.initialisize}" />< Propertyname= "Maxwait"value= "60000" />< Propertyname= "Minidle"value= "1" />< Propertyname= "Timebetweenevictionrunsmillis"value= "60000" />< Propertyname= "Minevictableidletimemillis"value= "300000" />< Propertyname= "Validationquery"value= "Select ' x ' from dual" />< Propertyname= "Testwhileidle"value= "true" />< Propertyname= "Testonborrow"value= "false" />< Propertyname= "Testonreturn"value= "false" />< Propertyname= "Poolpreparedstatements"value= "true" />< Propertyname= "Maxpoolpreparedstatementperconnectionsize"value= " the" /></Bean>

ConnectionProperties: Configure some properties of the connection, where the config.decrypt=true is configured to indicate that the supplied password is encrypted

Filters: is an interceptor, configurable monitoring, logging, etc.

Maxactive: Maximum number of connections

InitialSize: Initialize the number of connections

Minidle: Number of idle connections

Maxwait: Get connection Maximum wait time

Timebetweenevictionrunsmillis: Detection of connection time, per millisecond

Minevictableidletimemillis: Detects that a connection is not closed is greater than this value closes the connection, in milliseconds

Validationquery: This SQL statement verifies that the database is available at system startup, such as Oracle with SELECT ' X ' from Dual,mysql with select ' X '

Testwhileidle: Enable idle connection detection for recycling

Testonborrow: If connection availability is detected when getting connections from the connection pool, there is a slight impact on the performance of the switch

Testonreturn: If connection availability is detected when connecting to the connection pool, turn on performance can be somewhat affected

Poolpreparedstatements: Turn on Pscache Cache, Oracle set to True, non-Oracle set to False

Maxpoolpreparedstatementperconnectionsize: Maximum cache count, non-Oracle set to 0

Druid Data Source configuration

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.