Combopooleddatasource Detailed Configuration Instructions
<default-config>
<!--c3p0 The number of connections that are fetched at the same time when the connection in the connection pool is exhausted. Default:3--
<property name= "Acquireincrement" >3</property><!--defines the number of repeated attempts to obtain a new connection from the database after a failure. Default:30--
<property name= "acquireretryattempts" >30</property><!--two-time interval in milliseconds. default:1000--
<property name= "Acquireretrydelay" >1000</property><!--the connection is closed by default, all uncommitted actions are rolled back. Default:false--
<property name= "Autocommitonclose" >false</property><!--c3p0 will build a blank table named Test and test it with its own query statement. If this parameter is defined, then the attribute preferredtestquery will be ignored. You cannot do anything on this test sheet, it will be used only for C3P0 testing. Default:null-->
<property name= "automatictesttable" >Test</property> <!--getting a connection failure will cause any thread that waits for the connection pool to get the connection to throw an exception. However, the data source is still valid and continues to try to get the connection the next time you call Getconnection (). If set to True, the data source will declare broken and permanently shut down after attempting to acquire a connection failure. Default:false-->
<property name= "Breakafteracquirefailure" >false</property><!--client calls getconnection () when the connection pool is exhausted Wait for the time to get the new connection after the timeout will be thrown SqlException, if set to 0 wait indefinitely. Unit milliseconds. Default:0--
<property name= "Checkouttimeout" >100</property><!-- Test the connection by implementing a Connectiontester or Queryconnectiontester class. The class name needs to be set to the full path. Default:com.mchange.v2.c3p0.impl.defaultconnectiontester-->
<property name= "Connectiontesterclassname" ></property><!--Specify the path to the C3P0 libraries, if (usually it is) available locally then no setting is required, default null is Default:null-->
<property name= "Factoryclasslocation" >null</property><!--strongly disrecommended. Setting this to true may leads to subtle and bizarre bugs. (original document) author strongly recommends not to use a property--
<property name= "forceignoreunresolvedtransactions" >false</property><!--Check for idle connections in all connection pools every 60 seconds. Default:0--
<property name= "Idleconnectiontestperiod" >60</property><!--get three connections when initializing, The value should be between Minpoolsize and Maxpoolsize. Default:3--
<property name= "initialpoolsize" >3</property><!--maximum idle time, unused in 60 seconds, the connection is discarded. If 0, it will never be discarded. Default:0--
<property name= "MaxIdleTime" >60</property><!--the maximum number of connections that are kept in the connection pool. Default:15--
<property name= "Maxpoolsize" >15</property><!--the standard parameters of JDBC to control the number of preparedstatements loaded within the data source. However, because the pre-cached statements belong to a single connection instead of the entire connection pool. So setting this parameter takes into account a variety of factors. If both maxstatements and maxstatementsperconnection are 0, the cache is closed. Default:0-->
<property name= "maxstatements" >100</property><!-- Maxstatementsperconnection defines the maximum number of cache statements that a single connection in a connection pool has. Default:0--
<property name= "maxstatementsperconnection" ></property><!--c3p0 is asynchronous, and slow JDBC operations are done through the help process. Extending these operations can effectively improve performance by implementing multiple operations at the same time through multithreading. Default:3-->
<property name= "Numhelperthreads" >3</property><!--when a user calls getconnection () makes the root user the user to get the connection. Used primarily when connection pooling is connected to a non-c3p0 data source. Default:null-->
<property name= "Overridedefaultuser" >root</property><!--a parameter that corresponds to the Overridedefaultuser parameter. Default:null-->
<property name= "Overridedefaultpassword" >password</property><!--password. Default:null-->
<property name= "Password" ></property><!--define test statements that are executed by all connection tests. This one significantly improves the test speed in the case of connection testing. Note: The test table must exist at the time of the initial data source. Default:null-->
<property name= "preferredtestquery" >select ID from test where id=1</property><!-- The user waits up to 300 seconds before modifying the system configuration parameters to execute. DEFAULT:300--
<property name= "Propertycycle" >300</property><!--because of the high performance consumption please use it only when you need it. If set to true then the validity of each connection submission is officer. We recommend using methods such as Idleconnectiontestperiod or automatictesttable to improve the performance of your connectivity tests. Default:false--
<property name= "Testconnectiononcheckout" >false</property><!--if set to true then officer the validity of the connection while the connection is made. Default:false--
<property name= "Testconnectiononcheckin" >true</property><!--user name. Default:null-->
<property name= "User" >root</property> configuration in Hibernate (Spring Administration): <bean id= "DataSource" class= " Com.mchange.v2.c3p0.ComboPooledDataSource "destroy-method=" Close "><property name=" Driverclass ">< Value>oracle.jdbc.driver.oracledriver</value></property><property name= "JdbcUrl" ><value >jdbc:oracle:thin: @localhost: 1521:test</value></property><property name= "User" ><value >kay</value></property><property name= "Password" ><value>root</value></ property><!--The minimum number of connections that are kept in the connection pool. -
<property name= "minpoolsize" value= "/><!--the maximum number of connections that are kept in the connection pool. Default:15--
<property name= "maxpoolsize" value= "1800"/><!--maximum idle time, and the connection is discarded if not used in the same period. If 0, it will never be discarded. Default:0--
<property name= "MaxIdleTime" value= "1800"/><!--c3p0 the number of connections fetched at one time when the connection in the connection pool is exhausted. Default:3--
<property name= "Acquireincrement" value= "3"/><property name= "maxstatements" value= "$"/><property Name= "Initialpoolsize" value= "/><!--Check for idle connections in all connection pools every 60 seconds. Default:0--
<property name= "Idleconnectiontestperiod" value= "/><"!--defines the number of repeated attempts to obtain a new connection from the database after a failure. Default:30--
<property name= "acquireretryattempts" value= "" "/><property name=" Breakafteracquirefailure "value=" true "/ ><property name= "Testconnectiononcheckout" value= "false"/></bean>############################## C3P0 Connection pool############################## #hibernate. C3p0.max_size 2#hibernate.c3p0.min_size Hibernate.c3p0.timeout 5000#hibernate.c3p0.max_statements 100#hibernate.c3p0.idle_test_period 3000# Hibernate.c3p0.acquire_increment 2#hibernate.c3p0.validate False in Hibernate.cfg.xml file add the following configuration:<!--maximum number of connections--
<property name= "hibernate.c3p0.max_size" >20</property><!--min. connections--
<property name= "hibernate.c3p0.min_size" >5</property><!--Get the connection timeout, if more than this time, will throw an exception, in milliseconds--
<property name= "Hibernate.c3p0.timeout" >120</property><!--the largest number of PreparedStatement--
<property name= "hibernate.c3p0.max_statements" >100</property><!--Check the connection pool for idle connections every 120 seconds, in seconds--
<property name= "Hibernate.c3p0.idle_test_period" >120</property><!--when the connection in the connection pool is exhausted, c3p0 the number of new connections obtained -
<property name= "Hibernate.c3p0.acquire_increment" >2</property><!--Verify that the connection is available every time-
<property name= "Hibernate.c3p0.validate" >true</property>
Combopooleddatasource Detailed Configuration Instructions