You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Steve Cohen (JIRA)" <ji...@apache.org> on 2017/07/31 23:28:06 UTC

[jira] [Created] (DBCP-477) Documentation out of date and confusing

Steve Cohen created DBCP-477:
--------------------------------

             Summary: Documentation out of date and confusing
                 Key: DBCP-477
                 URL: https://issues.apache.org/jira/browse/DBCP-477
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 2.2
            Reporter: Steve Cohen
            Priority: Minor


The DBCP package description page ([https://commons.apache.org/proper/commons-dbcp/apidocs/org/apache/commons/dbcp2/package-summary.html#package_description]) is referred to from the Overview page
as containing important information on usage of the package.

The following sample code is provided there:
{noformat}
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);
{noformat}

This is out of date:  the six argument constructor for PoolableConnectionFactory has been removed.  Additionally, even if the correct constructor is used, nothing connects the PortableConnectionFactory created on the third line with the pool.

There is a much better sample at [https://git-wip-us.apache.org/repos/asf?p=commons-dbcp.git;a=blob;f=doc/PoolingDataSourceExample.java;h=2a12c74898930b9623223db1597b8a8052a6f1df;hb=56deeaf5ccbbee5081dbcce374685f4399d71bd5]

However this should be accessible from any of several "examples" links on the site, all of which are broken.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)