tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Andryc <>
Subject RE: Connection pooling doesn't work for me ... Help !!
Date Thu, 13 Jun 2002 21:31:44 GMT
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 Andryc
Web Systems Engineer
Phone: (413)-545-3460

-----Original Message-----
From: John McNally []
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.

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.

john mcnally

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message