The invention provides a control method of a
database connection pool. The control method includes: normalizing thread priority; judging whether the current
connection pool is empty or not, if not, taking out first
data connection, setting the current state to be busy, and returning to the
data connection; if yes, judging whether number of unreturned
data connection in a current external program reaches maximum number of connection in the
connection pool or not, if not, increasing the data connection prior to adding the same to the current
database connection
pool, and returning to the first data connection of the
database connection
pool; if the number of the unreturned data connection used in the current external program reaches the maximum number of the connection, setting the priority of the current thread, acquiring first time as
current time, circularly judging whether the current connection
pool is empty or not, and allowing the
database connection pool to enter a waiting state.
Data access performance can be effectively improved under the condition of high
concurrency and multi-
data source environment.