近期项目有这样的需求:
通过weblogic控制台配置一个数据源ds,然后在项目中使用这个ds来访问。
但是项目框架是ibatis + hivemind + struts2。
因为之前并没有用过hivemind,而datasource的引用需要在hivemind的配置中进行相应的配置。
无奈,不知道如何进行配置,请大家给点经验。
1 楼
znn1980
2009-09-09
Hashtable ht = new Hashtable(); ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); ht.put(Context.PROVIDER_URL, t3://127.0.0.1:7001); Context ctx = new InitialContext(ht); DataSource ds = (DataSource) ctx.lookup(jndiName); conn = ds.getConnection();