首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

resin jndi数据库连接池配备

2012-12-18 
resin jndi数据库连接池配置web.xml文件public int openConn(String dbName) {try {String jndiName app

resin jndi数据库连接池配置
web.xml文件

public int openConn(String dbName) {        try {            String jndiName = appconf.get(dbName);            DataSource ds = (DataSource) cachtable.get(jndiName);            if (ds == null) {                Context ctx = new InitialContext();                ds = (DataSource) ctx.lookup(jndiName);                cachtable.put(jndiName, ds);            }            conc = ds.getConnection();            return 0;        } catch (Exception e) {            e.printStackTrace();            return -1;        }    }


resin3.0和resin4.0都测试成功

热点排行