Garg said:
Good Morning All,
I am having a small confussion, can we implement connection pooling in
a simple java program with main method.
Thanks
Tarun Garg
Yes, you can very easily, but you should probably not be asking this
question yet. Since it is generally very simple to retrofit such pooling
into an application, you should probably build the application without
pooling, and only implement it if required after performance profiling
the application. You can help yourself with a possible retrofit by
centralising method calls to obtain connections - then only that method
needs changing. Anyhow, main thing is...don't optimise until you need
to, and pooling is definitely such an optimisation.
If you find you do need connection pooling, there are many out there
that could achieve what you want, for example:
Jakarta DBCP (as already mentioned)
Proxool
DBPool
etc.
Stan