Originally posted by Stan James:
The other approach hides the pooling. I'm not sure how they get connections; I used snipped ConnectionManager from a toy project.
This is a lot more work as you have to extend or wrap Connection to return to the pool instead of really closing and much more.
That's the Proxy design pattern. It's how the Jakarta Commons connection pool is implemented, for example. And it's not even that hard, if you know how to use
Java's dynamic proxies...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus