Hi,
I have a rather simple question: I would rather use a connection pool
but at the moment I need a quick solution to access a db. Right now I have
some beans which each have their own method to get a datbase connection, and
later release it. What I want to do is create a base class with these two
methods implemented and then all the beans subclassed from it so if I need
to change the db access code I only do it once.... Any comments or
suggestions? Is this a good way to handle this or would it be much better to
use the apache.commons.dbcp.BasicDataSource?
Thanks,
-Tomas
Scott Yanoff - 18 Sep 2003 19:51 GMT
> Hi,
>
[quoted text clipped - 6 lines]
> suggestions? Is this a good way to handle this or would it be much better to
> use the apache.commons.dbcp.BasicDataSource?
Can you just move the database connection stuff to a separate, generic
class and import that class in any of the beans that want to open a
connection to the database? Of course, you'd have to make the methods
generic enough to be called by any of the beans.
HTH,

Signature
-Scott
yanoff@STOP-SPAMMINGyahoo.com | http://www.yanoff.org | AOL IM: SAY KJY