| java.lang.Object uk.org.primrose.vendor.tomcat.NoJndiLoaderFactory
NoJndiLoaderFactory | public class NoJndiLoaderFactory implements ObjectFactory(Code) | | author: sedj author: author: public static Connection getPrimroseConnection() throws Exception { author: InitialContext ctx = new InitialContext(); author: PoolLoader pl = (PoolLoader)ctx.lookup("java:comp/env/AllPrimrosePools"); author: Pool myPool = pl.findExistingPool("myPoolName"); author: if (myPool != null) { author: return myPool.getConnection(); author: } else { author: // Can't find pool ... handle error author: throw new Exception("Cannot find pool"); author: } author: } author:
|
|
|