Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Can connection poolong be implemented in the simple java class?

Thread view: 
Garg - 29 Mar 2007 05:23 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.