Package org.eweb4j.orm.dao.config.bean

Examples of org.eweb4j.orm.dao.config.bean.DBInfoConfigBean


   *            找到这个值
   * @return
   */
  public static SelectDAO getSelectDAO(String dsName) {
    DataSource ds = DataSourceWrapCache.get(dsName);
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get(dsName);
    return new SelectDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here


  }

  public static SelectDAO getSelectDAO() {
    DataSource ds = DataSourceWrapCache.get();

    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get();

    return new SelectDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

   *            找到这个值
   * @return
   */
  public static InsertDAO getInsertDAO(String dsName) {
    DataSource ds = DataSourceWrapCache.get(dsName);
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get(dsName);
    return new InsertDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

    return new InsertDAOImpl(ds, dcb.getDataBaseType());
  }

  public static InsertDAO getInsertDAO() {
    DataSource ds = DataSourceWrapCache.get();
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get();
    return new InsertDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

   *            找到这个值
   * @return
   */
  public static SearchDAO getSearchDAO(String dsName) {
    DataSource ds = DataSourceWrapCache.get(dsName);
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get(dsName);
    return new SearchDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

    return new SearchDAOImpl(ds, dcb.getDataBaseType());
  }

  public static SearchDAO getSearchDAO() {
    DataSource ds = DataSourceWrapCache.get();
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get();
    return new SearchDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

   *            找到这个值
   * @return
   */
  public static DivPageDAO getDivPageDAO(String dsName) {
    DataSource ds = DataSourceWrapCache.get(dsName);
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get(dsName);
    return new DivPageDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

    return new DivPageDAOImpl(ds, dcb.getDataBaseType());
  }

  public static DivPageDAO getDivPageDAO() {
    DataSource ds = DataSourceWrapCache.get();
    DBInfoConfigBean dcb = DBInfoConfigBeanCache.get();
    return new DivPageDAOImpl(ds, dcb.getDataBaseType());
  }
View Full Code Here

          + filePath);
      try {
        XMLReader reader = BeanXMLUtil.getBeanXMLReader(configFile);
        reader.setBeanName("dataSource");
        reader.setClass("dataSource", DBInfoConfigBean.class);
        DBInfoConfigBean dcb = reader.readOne();
        if (dcb == null) {
          error = rebuildXmlFile(configFile,
              ConfigInfoCons.REPAIR_FILE_INFO);
        } else {
          String error1 = CheckConfigBean.checkORMDBInfo(dcb,
              filePath);
          if (error1 == null) {
            DBInfoConfigBeanCache.add(dcb.getDsName(), dcb);
            DataSource ds = DataSourceCreator.create(dcb);
            DataSourceWrap dsw = new DataSourceWrap(
                dcb.getDsName(), ds);

            String error2 = dsw.getConnection() == null ? ConfigInfoCons.CANNOT_GET_DB_CON
                : null;

            if (error2 != null)
              if (error == null)
                error = error2;
              else
                error += error2;

            else {
              String info = dcb.getDsName()
                  + ConfigInfoCons.READ_CONFIG_INFO_SUCCESS;
              LogFactory.getORMLogger("INFO").write(info);
              // ------log-------
              // 将数据源放入缓存,它可是个重量级对象
              // 此步也是为了共存多个数据源
              DataSourceWrapCache.put(dcb.getDsName(), dsw);
            }
          } else if (error == null)
            error = error1;
          else
            error += error1;
View Full Code Here

  public static DBInfoConfigBean get(String beanID) {
    if (beanID == null || beanID.trim().length() == 0)
      return get();

    DBInfoConfigBean dcb = ht.get(beanID);
    return dcb;
  }
View Full Code Here

TOP

Related Classes of org.eweb4j.orm.dao.config.bean.DBInfoConfigBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.