怎么在Jb8+Weblogic中指定连接池(已配置多个连接池) 可以删掉看看这里吧,http://www.csdn.net/develop/article/15/15250.shtm 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 当然可以删除了,你在特定的工程中要显式的申明用哪个Hashtable ht = new Hashtable(); ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); try { Context ctx = new InitialContext(ht); DataSource ds = (DataSource)ctx.lookup("SQLServer"); Connection con = ds.getConnection("system","12345678");//此处是WebLogic7的域用户和密码 Statement st = con.createStatement(); ResultSet res = st.executeQuery("select * from employees"); String line = ""; while (res.next()) line = line + res.getString("notes")+"\n"; jTextArea1.setText(line); con.close(); } catch (Exception ex) { jTextArea1.setText("error : "+ex.getMessage()); } 急.急.急!!!各位大虾帮忙看看问题 不启动web项目 如何加载web.xml 中的servlet cvsnt有适合 eclipse3.2 版的版本吗 Struts+Tomcat+mysql配置数据源问题 谁来救救我,我的WEBSPHERE近这几个星期常常死掉服务! 数据库 本人在广州,现有一项目(B/S) 谁做过xml加密? xml+xsl如何进行数据查找 在EJB中只能指定一个数据源,那请问SessionBean如何操作多个数据库中的信息呢? 求教批量录入的问题? 在jb8中写一下程序,为何非要我抛出异常
Hashtable ht = new Hashtable(); ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); try { Context ctx = new InitialContext(ht); DataSource ds = (DataSource)ctx.lookup("SQLServer"); Connection con = ds.getConnection("system","12345678");//此处是WebLogic7的域用户和密码 Statement st = con.createStatement(); ResultSet res = st.executeQuery("select * from employees"); String line = ""; while (res.next()) line = line + res.getString("notes")+"\n"; jTextArea1.setText(line); con.close(); } catch (Exception ex) { jTextArea1.setText("error : "+ex.getMessage()); }