tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@shareowner.com
Subject could not cast dbcp objects created using tomcat JNDI
Date Mon, 28 Oct 2002 20:17:14 GMT
I retrieved an object of DataSource using Tomcat's JNDI simulation. It is an
instance of BasicDataSource. I tried to cast it to BasicDataSource and got a
ClassCastException.
 
Context ctx = new InitialContext() ;
Context envCtx = (Context) ctx.lookup("java:comp/env") ;
DataSource ds = (DataSource) envCtx.lookup("jdbc/myoracle") ;
BasicDataSource basic = (BasicDataSource) ds ;
 
Actually, I cannot cast any DBCP objects, e.g. PoolableConnection.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message