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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to