Package com.exedosoft.plat.bo

Examples of com.exedosoft.plat.bo.DODataSource


    if (properties.size() == 0) {
      return;
    }

    // 总面板面呈
    DODataSource dds = DODataSource.parseGlobals();
    DAOUtil.INSTANCE().currentDataSource(dds);
    Transaction t = dds.getTransaction();

    try {

      if (DOPaneModel.getPaneModelByName(mainPaneName) != null) {
        System.err.println("面板已经存在------------");
View Full Code Here


    processInstance = getProcessInstance();
    processInstance.setExeStatus(Integer
        .valueOf(ProcessInstance.STATUS_FINISH));

    DOBO auth = DOBO.getDOBOByName("do_authorization");
    DODataSource dss = auth.getDataBase();
    Transaction ts = dss.getTransaction();
    ts.begin();

    try {
      DAOUtil.BUSI().store(processInstance);
View Full Code Here

  public static Connection getConnection() {
    Connection conn = null;
    try {
//      Class.forName(driverName);
//      conn = DriverManager.getConnection(url, user, password);
      DODataSource dss = DODataSource.getDataSourceByL10n("紫枫报销数据库I");
       conn = dss.getConnection();
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return conn;
View Full Code Here

  }

  public static void testProduce() {

    DODataSource ds = DODataSource.getDataSourceByL10n("计量院系统数据库");
    System.out.println(ds);
    Connection con = null;
    CallableStatement pstmt = null;
    try {

      con = ds.getConnection();
      System.out.println(con.getCatalog());

      // "{call SP_GetDeptRegInfo(?)}";
      pstmt = con.prepareCall("SubmitChildProject(?,?)",
          ResultSet.TYPE_SCROLL_INSENSITIVE,
          ResultSet.CONCUR_READ_ONLY);

      pstmt.setString(1, "1");
      pstmt.registerOutParameter(2, Types.VARCHAR);

      pstmt.execute();
      String outp = pstmt.getString(2);
      System.out.println("outpoutpoutpoutpoutpoutpoutpoutpoutp:::::"
          + outp);

    } catch (SQLException ex) {
      ex.printStackTrace();
    } finally {
      try {
        if (pstmt != null) {
          pstmt.close();
        }
        ds.ifCloseConnection(con);
      } catch (Exception ex1) {
        ex1.printStackTrace();
      }
    }
View Full Code Here

    try {
      con = this.getConnection();
      DatabaseMetaData meta = con.getMetaData();
      System.out.println(con.getCatalog());
     
      DODataSource dds = (DODataSource) DAOUtil.INSTANCE().getByObjUid(
          DODataSource.class, this.dataSourceUid);

      String schema = null;
     
      if (dds.isOracle()) {
        schema = dds.getUserName().trim().toUpperCase();
      }
      ResultSet rs = meta.getColumns(null, schema, aTable, null);

      while (rs.next()) {
        SqlCol qc = new SqlCol();
View Full Code Here

  public Connection getConnection() {

    if (this.dataSourceUid != null) {

      try {
        DODataSource dds = null;
        if ("true".equals(DOGlobals.getValue("multi.tenancy"))) {

          dds = DOGlobals.getInstance().getSessoinContext()
              .getTenancyValues().getDataDDS();
        }
        if (dds == null) {
          dds = (DODataSource) DAOUtil.INSTANCE().getByObjUid(
              DODataSource.class, this.dataSourceUid);
        }
        return dds.getConnection();
      } catch (Exception e) {
        e.printStackTrace();
        return null;
      }
    } else {
View Full Code Here

   
    String schema = null;
    if (this.dataSourceUid != null) {

      try {
        DODataSource dds = null;
        if ("true".equals(DOGlobals.getValue("multi.tenancy"))) {
         
          dds = DOGlobals.getInstance().getSessoinContext()
              .getTenancyValues().getDataDDS();
        }
        if (dds == null) {
          dds = (DODataSource) DAOUtil.INSTANCE().getByObjUid(
              DODataSource.class, this.dataSourceUid);
        }
        if (dds.isOracle() || dds.isDB2()
            || "h2".equals(dds.getDialect())) {

          aTable = aTable.toUpperCase();
        }

        if (dds.isOracle()) {
          schema = dds.getUserName().trim().toUpperCase();
        }


      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

  private static String ENTRYDN = null;
  final static String[] attrNames = { "sn", "mobile", "mail", "cn" };

  private static LDAPConnection getConnection() {
    DODataSource dss1 = DODataSource.parseConfigHelper("/ds_ldap_url.xml",
        "ds_ldap_url");
    String dn = dss1.getUserName();
    if (dn != null && dn.trim().length() > 0)
      if (dn.trim().substring(0, 1).matches("^\\W$"))
        ENTRYDN = dn.trim().substring(1);
      else
        ENTRYDN = dn.trim();
    String MY_URL = dss1.getDriverUrl();
    if (MY_URL != null && MY_URL.trim().length() > 0) {
      if (MY_URL.trim().contains("//")
          && MY_URL.trim().substring(MY_URL.trim().length() - 1).equals("/"))
        MY_URL = MY_URL.trim().substring(MY_URL.trim().indexOf("//")+2,
            MY_URL.trim().length() - 1);
      else if (MY_URL.trim().contains("//")
          && !MY_URL.trim().substring(MY_URL.trim().length() - 1).equals("/"))
        MY_URL = MY_URL.trim().substring(MY_URL.trim().indexOf("//")+2);
    }
    DODataSource dss2 = DODataSource.parseConfigHelper("/ds_ldap.xml",
        "ds_ldap");

    final String MY_USER = dss2.getUserName();
    final String password = dss2.getPassword();

    String url = dss2.getDriverUrl();
    String sPort1 = null;
    if (MY_URL.substring(MY_URL.length() - 1).equals("/"))
      sPort1 = url.substring(url.indexOf(MY_URL.substring(0, MY_URL
          .lastIndexOf("/")))
          + MY_URL.length());
View Full Code Here

    DOBO aBO = new DOBO();
    aBO.setType(DOBO.TYPE_BUSINESS);
    aBO.setName(project.getName() + "global.bo");
    aBO.setL10n(project.getL10n() + "全局业务对象");
   
    DODataSource dds = DODataSource.parseGlobals();
   
    Transaction t = dds.getTransaction();
   
    t.begin();
   
    try {
      // //////////保存业务包
View Full Code Here

    // tenant data datastore url
    String multi_datasource_uid = tenant.getValue("multi_datasource_uid");
    // tenant config datastore url
    String model_datasource_uid = tenant.getValue("model_datasource_uid");

    DODataSource dataDds = null;
    DODataSource dds = null;
    if (multi_datasource_uid != null && model_datasource_uid != null) {

      DOService findDataSource = DOService
          .getService("multi_datasource_browse");

      // //data datasource
      BOInstance aBI = findDataSource.getInstance(multi_datasource_uid);
      if (aBI != null) {
        dataDds = (DODataSource) aBI.toObject(DODataSource.class);
        // /现在多租户情况下默认都是mysql
        dataDds.setDialect(DODataSource.DIALECT_MYSQL);
      }

      // /model datasource
      aBI = findDataSource.getInstance(model_datasource_uid);
      if (aBI != null) {
        dds = (DODataSource) aBI.toObject(DODataSource.class);
        // /现在多租户情况下默认都是mysql
        dds.setDialect(DODataSource.DIALECT_MYSQL);
      }
    }

    if (dataDds == null || dds == null) {
      return I18n.instance().get("该账号没有被激活或者没有正确初始化,请与管理员联系!");
View Full Code Here

TOP

Related Classes of com.exedosoft.plat.bo.DODataSource

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.