2

我正在尝试集成 UCP 和 tomcat,并且我已经按照 oracle 文档中的说明正确配置了,但仍然缺少某些内容,并且在连接时出现以下异常

java.sql.SQLException: Unable to start the Universal Connection Pool: oracle.ucp
.UniversalConnectionPoolException: Cannot get Connection from Datasource

我在我的 lib 文件夹和 context.xml 中定义了所有 jar 文件,但仍然需要知道我哪里出错了,或者我缺少以下内容是引发异常的代码

pds=PoolDataSourceFactory.getPoolDataSource();

     // Setting connection parameters
     pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");

     pds.setURL("jdbc:oracle:thin:@//localhost:1521:xe");
     pds.setUser("hr");
     pds.setPassword("hr"); // till here working fine 

     // setting pool properties 
     pds.setInitialPoolSize(5);  // throws above mentioned Exception 
     pds.setMinPoolSize(5);
     pds.setMaxPoolSize(15);
     System.out.println("Creating pool /// debug 4");
     System.out.println("Creating pool .... finish");
4

0 回答 0