I would like to develop database connection pooling.
Could anyone please tell me about which data structure need to use to maintain the pool ?
It should be implemented using Object Pool desing pattern. You can read about it in
Kircher, Michael; Prashant Jain; (2002-07-04). "Pooling Pattern". EuroPLoP 2002. Retrieved on 2007-06-09. or in Object Pool Design Pattern. Java implementation for ObjectPool
and JDBCConnectionPool
classes can be found here.
Object Pool is usually a singleton with two collections of objects (e.g. database connections) inside:
This collections can be implemented as Lists
or HashTables
or something else, depends on your needs. For simple ObjectPool - LinkedList
structure will be good enough.
See http://www.javaworld.com/jw-06-1998/jw-06-object-pool.html. Good luck!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With