Hi,
I am also trying to use Connection Pooling using a simple java class in VAJ 3.5.
When I try to run the program, debugger opens with NoClassDefFoundError exception.
I am using the following code:-
javax.naming.InitialContext ctx =null;
javax.sql.DataSource ds =null;
Properties parms = new Properties();
try {
parms.put(Context.PROVIDER_URL,"iiop://localhost:900");
parms.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
ctx=new InitialContext(parms);
}
catch (Exception e) {
System.out.println("Exception= "+e);
}
try{
ds = (DataSource)ctx.lookup("jdbc/dbname");
Connection conn =ds.getConnection("scot","tiger");
}
catch (Exception e) {
System.out.println("Exception= "+e);
}
When I use the same code in a servlet, it runs fine. Can I use Connection pooling in simple class?
Regards,
kapil