论坛首页 Java企业应用论坛

weblogic的datasourse如何配置到项目中去

浏览 1636 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2009-09-09  
  近期项目有这样的需求:
  通过weblogic控制台配置一个数据源ds,然后在项目中使用这个ds来访问。
  但是项目框架是ibatis  +   hivemind  +  struts2。
  因为之前并没有用过hivemind,而datasource的引用需要在hivemind的配置中进行相应的配置。
  无奈,不知道如何进行配置,请大家给点经验。   
   发表时间: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();
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics