[Biojava-dev] JDBCConnectionPool

Thomas Down td2 at sanger.ac.uk
Wed May 12 06:19:38 EDT 2004


On 12 May 2004, at 02:12, Francois Pepin wrote:

> Hi everyone,
>
> what is happening with JDBCConnectionPool? The last commit (by mrp in
> November) says it might be deprecated soon and the docs says a standard
> should be found soon.
>
> The code for takeConnection() is a bit weird, because the code that
> would check if we can reuse a connection is commented out, so a new
> connection is created every time. It works, but it kinds of defeat the
> purpose of the class.

It looks like this class was "broken" intentionally in CVS revision 
1.5, and has never been reinstated.  I'm not sure if there's much need, 
either -- BioSQL is now using the javax.sql.DataSource-style connection 
pooling.  The rewritten biojava-ensembl does too (and it never really 
used the JDBCConnectionPool class from BioJava anyway, it had its own 
version -- actually the original which later got copied into BioJava).

Does anyone know anything else which uses JDBCConnectionPool?

It's evil anyway.  I wrote it in the dark old days when the javax.sql 
package wasn't a standard part of J2SE, and there wasn't an easily 
available general purpose implementation.  It certainly shouldn't be 
used for new code.

> I need to use connection pooling but I'm not sure if I'd be better to
> try to fix that one or just use the Apache commons-dbcp
> (http://jakarta.apache.org/commons/dbcp/).


Yes, you're definitely better off using that.

       Thomas.



More information about the biojava-dev mailing list