Need code to create the connection pool in java? How does we make sure that connection pool doesn\'t return the same object which is already in use? How happens if client cl
Just use Semaphores. Ideally what you should do is use CP3O or DBCP as your connection pool. Now you can throttle you connection based on Semaphore.
CP3O
DBCP
Every time you do Get, you acquire and on every Release you release it from Semaphore. More over semaphores are thread safe.
Get
Release