Oracle UCP sql异常无法获取与数据源的连接

时间:2014-03-16 16:02:29

标签: java tomcat ucp

我正在尝试集成UCP和tomcat,我已经使配置正确,如oracle文档中给出的但仍然缺少某些东西,并且在连接时我得到以下异常

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

我的lib文件夹中定义了所有jar文件,并定义了context.xml,但是仍然需要知道我出错的地方或者我遗漏的内容是抛出异常的代码

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");

0 个答案:

没有答案