ServletContext application = sce.getServletContext();
/*
* Get the JDBC URL, user, password and limit from the web.xml
* context init parameters
*/
String jdbcURL = application.getInitParameter("jdbcURL");
String user = application.getInitParameter("user");
String password = application.getInitParameter("password");
String maxLimit = application.getInitParameter("maxLimit");
try {
ds = new OracleConnectionCacheImpl();
ds.setURL(jdbcURL);
ds.setMaxLimit(Integer.parseInt(maxLimit));
ds.setUser("scott");
ds.setPassword("tiger");
}
catch (Exception e) {
application.log("Failed to create data source: " + e.getMessage());
}
application.setAttribute("appDataSource", ds);