Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> connection pooling exception
Hi,
I am using java servlet and Oracle 8.1.6 database. I used the OracleConnectionCacheImpl class to achieve connection pooling. However, sometimes the application server will output the following exception. Is it becase that the pool is used up for any other reason? Any other better practice to do connection pooling using servlet?
Thanks.
Chris
Exception:
Servlet class cwSQL Source Code :
private static OracleConnectionCacheImpl ods = null;
public void cwSQL() {;}
public Connection openDB() {
if (ods == null) {}
// Create a OracleConnectionPoolDataSource as an factory
// of PooledConnections for the Cache to create.
OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource(); ocpds.setURL("jdbc:oracle:thin:@"+ dbHost + ":" + dbPort + ":" + dbName); ocpds.setUser(usrNm); ocpds.setPassword(usrPw);
// Associate it with the Cache
ods = new OracleConnectionCacheImpl(ocpds);
// Set the Max Limit
ods.setMaxLimit (20); } con = ods.getConnection();