commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Cohen <sco...@javactivity.org>
Subject [dbcp] outdated and confusing documentation
Date Mon, 31 Jul 2017 16:07:38 GMT
The DBCP package description page is referred to from the Overview page
as containing important information on usage of the package.

The following sample code is provided there:


> GenericObjectPool connectionPool = new GenericObjectPool(null);
> ConnectionFactory connectionFactory = new DriverManagerConnectionFactory("jdbc:some:connect:string",
"username", "password");
> PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
> PoolingDataSource dataSource = new PoolingDataSource(connectionPool);



The third line appears out of date:  No such constructor of
PoolableConnectionFactory appears to exist.  Instead I find

PoolableConnectionFactory(ConnectionFactory connFactory, ObjectName
dataSourceJmxName)

OK, I can use that.

But ...
Eclipse is warning me that this PoolableConnectionFactory is not used in
the code.  And it's right!  Nothing ties the poolableConnectionFactory
object we create in that line to anything else, and it doesn't appear to
be needed.

At any rate, I'm confused.  What role does this object play in the
scenario the documentation is referring to?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message