Database Structuring

I would like to create a database connection pool.

Can someone tell me which data structure should be used to support the pool?

+3
source share
7 answers

It should be implemented using the Object Pool desing pattern . You can read about it in Kircher, Michael; Prashant Jane; (2002-07-04). Pool Association. EuroPLoP 2002. Received 2007-06-09. or in the Object Pool Design Template . Java implementation for classes ObjectPooland JDBCConnectionPoolcan be found here .

singleton (, ) :

  • - ,
  • - ,

Lists HashTables - , . ObjectPool - LinkedList .

+7

, , , ​​ Commons DBCP, .

+4

:

  • - "" Connection , , , , .. - , ,
  • , , / - , ConcurrentLinkedQueue
  • - Semaphore class
  • , - " " (, "getConnection ( , readOnly)", ).

, /.

. , , , - () , () , , , .

+2
0

. Sun: :

JDBC 2.0 , . JDBC 2.0 , JDBC-.

0
0

Source: https://habr.com/ru/post/1709172/


All Articles