I wasn't aware of that. Thank you. When I was looking to do Oracle pooling I did a search on Google groups and asked around in which 99% of the posts used this method. I never heard of the Jdbc2PoolDataSource.
Kevin Kevin Andryc Web Systems Engineer MISER http://www.umass.edu/miser/ Phone: (413)-545-3460 [EMAIL PROTECTED] -----Original Message----- From: John McNally [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 13, 2002 05:25 PM To: Tomcat Users List Subject: Re: Connection pooling doesn't work for me ... Help !! > > > > In your code: > > > > Context initCtx = new InitialContext(); > > OracleConnectionPoolDataSource ocpds = > > (OracleConnectionPoolDataSource)initCtx.lookup("mydb"); > > PooledConnection pooledConnection = ocpds.getPooledConnection(); > > Connection connection = pooledConnection.getConnection(); > > Statement statement = connection.createStatement(); > > ResultSet resultSet = statement.executeQuery(sql); > > This is not the correct way to to use a ConnectionPoolDataSource. An application should only interact with DataSource's. I don't know oracle jdbc drivers very well, but I assume that they provide a DataSource implementation and if you do not care to have connection pooling you should use that. A ConnectionPoolDataSource does not provide connections that are pooled somehow internally. It is meant to be used by application servers or other middle-ware software which might include connection pooling. This middle-ware layer will present a DataSource front-end for applications to use and the ConnectionPoolDataSource will be used as its source of physical connections. <shameless-plug> If you are looking for a connection pool that will use the ConnectionPoolDataSource provided by oracle, you can find one in jakarta-commons-sandbox/jdbc2pool. It is the Jdbc2PoolDataSource class. </shameless-plug> john mcnally -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
