Migrates to Apache Commons DBCP 2.x

MSAL

Migrate applications from Apache Commons DBCP 1.x to the latest 2.x release. This recipe changes the dependency, moves the org.apache.commons.dbcp package to org.apache.commons.dbcp2, renames the data source properties that changed in Java, in Spring bean definitions and in the properties files BasicDataSourceFactory is given, and replaces the classes that were removed. Code that wires PoolableConnectionFactory to a commons-pool ObjectPool by hand has to be ported to commons-pool2 by hand, and no longer compiles until it is. BasicDataSourceFactory silently ignores the old names maxActive, maxWait and removeAbandoned wherever they remain, such as in a properties file named outside of the class that calls createDataSource, or in a Properties filled in code.

org.openrewrite.apache.commons.dbcp.UpgradeApacheCommonsDbcp_1_2
mod run . --recipe=org.openrewrite.apache.commons.dbcp.UpgradeApacheCommonsDbcp_1_2

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.