commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Cohen <stevec...@attbi.com>
Subject Re: JNDI, Tomcat, Distributed Apps, et al.
Date Sun, 16 Jun 2002 18:31:54 GMT
On Sunday 16 June 2002 12:24 pm, John McNally wrote:
> > With new JDBC specs you can do stuff like:
> >
> > DataSource ds = context.lookup("jdbc/whatever");
> >
> > if (ds instanceof ConnectionPoolDataSource)
> > {
> >    /* return a connection from the pool: */
> >    PooledConnection pc = ds.getPooledConnection();
> >    Connection conn = pc.getConnection();
> >    return conn;
> > }
> > else /* return a non-pooled connection */
> >    return ds.getConnection();
>
> Applications should not use ConnectionPoolDataSource or
> PooledConnection.  These interfaces are used to define the interaction
> between a pooling DataSource implementation and a jdbc2+ driver
> implementation.  A ConnectionPoolDataSource is a source of new db
> connections for a connection pool.
>
>
> john mcnally

In other words, isn't what you're saying that this logic is completely 
unnecessary?  This if ds happens to be instanceof ConnectionPoolDataSource, 
any Connection it returns WILL BE instanceof PooledConnection, otherwise not?

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message