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
pelakh@yahoo.com - 29 Mar 2007 06:10 GMT
Connection pooling for what? JDBC? RMI? Generic connectors?
Garg - 29 Mar 2007 09:27 GMT
basically i have to use persistent database connection. and i am
planning to achive that by pooling JDBC connection.
Wojtek - 29 Mar 2007 14:11 GMT
Garg wrote :
> basically i have to use persistent database connection. and i am
> planning to achive that by pooling JDBC connection.
Google proxool

Signature
Wojtek :-)
Brzezi - 29 Mar 2007 09:46 GMT
czw, 29 mar 2007 o 06:23 GMT, Garg napisał(a):
> I am having a small confussion, can we implement connection pooling in
> a simple java program with main method.
Yes, you can, use for example DBCP
Pozdrawiam
Brzezi

Signature
[ E-mail: brzezi@enter.net.pl ][ It's easier to fight for one's ]
[ Ekg: #3781111 ][ principles than to live up to them. ]
[ LinuxUser: #249916 ][ ]
Ian Wilson - 29 Mar 2007 11:07 GMT
> Good Morning All,
>
> I am having a small confussion, can we implement connection pooling in
> a simple java program with main method.
Yes.
Stan - 02 Apr 2007 12:40 GMT
> Good Morning All,
>
[quoted text clipped - 3 lines]
> 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
Garg - 02 Apr 2007 14:53 GMT
As i am writing a very simple java program with main thread, so i want
to mine own utility for this. But i am not getting the steps to write
the pool.
what i am planning is to write a static connection and use it and
whenever it throws a SQLException make another database connection.
Can i achive my goal through this?
thanks
Tarun Garg
Stan - 03 Apr 2007 08:17 GMT
> As i am writing a very simple java program with main thread, so i want
> to mine own utility for this. But i am not getting the steps to write
[quoted text clipped - 7 lines]
> thanks
> Tarun Garg
In my opinion the main art of the programmer is being able to translate
from a set of requirements into a workable algorithm. What you propose
seems very achievable, but I don't think using a connection pool will
necessarily help you solve the problem, as it seems more likely a
conceptual programming problem.
If this is not the case then I apologise for my assumption, but if so I
suggest the best solution to your problem is to find information on the
essentials of object-oriented programming in Java, and also JDBC
programming.
Stan