I want to setup a connection pool for a Oracle DB in a Helper class.
public class DbConnection {
// Data source for the pooled connection
private static Ora
oracle.jdbc.pool.OracleDataSource.setConnectionCachingEnabled
documentation state the following:
Deprecated. Use Oracle Universal Connection Pool instead.
You can download Oracle Database UCP and create your DataSource
as follows:
import oracle.jdbc.pool.OracleDataSource;
import oracle.ucp.jdbc.PoolDataSource;
import oracle.ucp.jdbc.PoolDataSourceFactory;
PoolDataSource poolDataSource = PoolDataSourceFactory.getPoolDataSource();
poolDataSource.setConnectionFactoryClassName(OracleDataSource.class.getName());
poolDataSource.setURL("jdbc:oracle:thin:@localhost:1521:XE");
poolDataSource.setUser("SYSTEM");
poolDataSource.setPassword("****");