commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John McNally <jmcna...@collab.net>
Subject Re: JNDI, Tomcat, Distributed Apps, et al.
Date Sun, 16 Jun 2002 17:24:57 GMT
> 
> 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


--
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