不明白,只知道能绑定EJB,和数据库。
引用的话。
Context ic = new InitialContext();
Object o = ic.lookup("绑定的名字");
然后,转换成相应的类型。

解决方案 »

  1.   

    1:得到的这个(jndi:/localhost/OA/WEB-INF/DataSource.xml) String,这个也就是得到DataSource.xml的路径
    2:SAXBuilder sxb = new SAXBuilder();
       FileInputStream fi = new FileInputStream(path);  //path也就是1中得到的path
       Document doc = sxb.build(fi);
      

  2.   

    private void createPools(Properties props) {
       Enumeration propNames = props.propertyNames();
       while (propNames.hasMoreElements()) {
       String name = (String) propNames.nextElement();
       if (name.endsWith(".url")) {
         String poolName = name.substring(0, name.lastIndexOf("."));
         String url = props.getProperty(poolName + ".url");
         if (url == null) {
           log("没有为连接池" + poolName + "指定URL");
           continue;
         }
       String user = props.getProperty(poolName + ".user");
       String password = props.getProperty(poolName + ".password");
       String maxconn = props.getProperty(poolName + ".maxconn", "0");
       int max;
      

  3.   

    protected String config = "/WEB-INF/DataSource.xml";
    InputStream requestMappingsURL = getServletContext().getResourceAsStream(config);再把这个流当成你的xml builder的输入流。
      

  4.   

    你看看java i/o的流操作内容你就明白了。