Package com.founder.fix.bpmn2extensions.coreconfig

Examples of com.founder.fix.bpmn2extensions.coreconfig.DataBase


  private ProcessEngine getProcessEngine(String userId) throws Exception{
      Connection connection = null;
      ProcessEngine processEngine=ProcessEngineManagement.getDefaultProcessEngine();
    //获取流程当前配置的数据库信息
    DataBase dataBase=processEngine.getProcessEngineConfiguration().getSelectedDatabase();
    String driver = dataBase.getDriverClassName();
    String url = dataBase.getUrl();
    String user = dataBase.getUsername();
    String password = dataBase.getPassword();
    //创建Connection
    Class.forName(driver);
    connection = DriverManager.getConnection(url, user, password);
    connection.setAutoCommit(false);
    ExternalContent externalContent =new ExternalContent();
View Full Code Here


  }

  public Connection getConnection() {

    if (this.connection == null) {
      DataBase selectedDatabase = null;
      FixFlowConfig fixFlowConfig = ProcessEngineManagement.getDefaultProcessEngine().getProcessEngineConfiguration()
          .getFixFlowConfig();
      for (DataBase dataBase : fixFlowConfig.getDataBaseConfig().getDataBase()) {
        if (dataBase.getId().equals(this.dbId)) {
          selectedDatabase = dataBase;
          //ConnectionManagement.defaultDataBaseId = selectedDatabase.getId();
        }
      }

      DataBase dataBase = selectedDatabase;
      Connection connection = null;
      String driver = dataBase.getDriverClassName();
      String url = dataBase.getUrl();
      String user = dataBase.getUsername();
      String password = dataBase.getPassword();

      try {
        Class.forName(driver);
        connection = DriverManager.getConnection(url, user, password);
        connection.setAutoCommit(false);
View Full Code Here

    String driverClassName = "";
    String url = "";
    String username = "";
    String driverDelegateClass = "";
    String password = "";
    DataBase quartzDataBase = null;

    if (StringUtil.getBoolean(quartzConfig.getIsDefaultConfig())) {
      quartzDataBase = selectedDatabase;
    } else {

      String selectedDB = quartzConfig.getDataBaseId();
      for (DataBase dataBase : fixFlowConfig.getDataBaseConfig().getDataBase()) {
        if (dataBase.getId().equals(selectedDB)) {
          quartzDataBase = dataBase;
        }
      }

    }

    if (quartzDataBase == null) {
      throw new FixFlowException("定时任务框架启动失败!未找到指定的数据库");
    }

    driverClassName = quartzDataBase.getDriverClassName();
    url = quartzDataBase.getUrl();
    username = quartzDataBase.getUsername();
    password = quartzDataBase.getPassword();

    if (quartzDataBase.getDbtype().equals(DBType.ORACLE)) {
      driverDelegateClass = "com.founder.fix.fixflow.expand.quartz.jdbcjobstore.oracle.OracleDelegate";
      // driverDelegateClass =
      // "org.quartz.impl.jdbcjobstore.oracle.OracleDelegate";//org.quartz.impl.jdbcjobstore.StdJDBCDelegate
    } else {

      if (quartzDataBase.getDbtype().equals(DBType.SQLSERVER)) {
        driverDelegateClass = "org.quartz.impl.jdbcjobstore.MSSQLDelegate";
      } else {
        driverDelegateClass = "org.quartz.impl.jdbcjobstore.StdJDBCDelegate";
      }
View Full Code Here

      taskCommandDefMap.put(id, taskCommandDef);
    }
  }
 
  public Connection createConnection() {
    DataBase dataBase = this.selectedDatabase;
    Connection connection = null;
    String driver = dataBase.getDriverClassName();
    String url = dataBase.getUrl();
    String user = dataBase.getUsername();
    String password = dataBase.getPassword();

    try {
      Class.forName(driver);
    } catch (Exception e) {
      throw new FixFlowException("数据库链接创建失败!", e);
View Full Code Here

  protected void initDbConfig() {
    // Element dataBaseConfigEle =
    // getDataBaseConfigEle(getFixFlowConfigDoc());

    DataBase dataBase = this.selectedDatabase;
    if (dataBase != null) {
      if (dataBase.getDbtype().toString().toLowerCase().equals(DbType.SQLSERVER.toString().toLowerCase())) {
        initSqlServerDbConfig();
        return;
      }
      if (dataBase.getDbtype().toString().toLowerCase().equals(DbType.ORACLE.toString().toLowerCase())) {
        initOracleDbConfig();
        return;
      }
      if (dataBase.getDbtype().toString().toLowerCase().equals(DbType.MYSQL.toString().toLowerCase())) {
        initMySqlDbConfig();
        return;
      }
      if (dataBase.getDbtype().toString().toLowerCase().equals(DbType.DB2.toString().toLowerCase())) {
        initDB2DbConfig();
        return;
      }
      initOracleDbConfig();
    } else {
View Full Code Here

     */
  }

  protected void initSqlServerDbConfig() {

    DataBase dataBase = this.selectedDatabase;

    // OraclePaginationImpl
    Pagination pagination = (Pagination) ReflectUtil.instantiate(dataBase.getPaginationImpl());
    DbConfig dbConfig = new DbConfig();
    dbConfig.setDbType(DbType.SQLSERVER);
    dbConfig.setPagination(pagination);
    dbConfig.setKeyword("?");

View Full Code Here

    this.dbConfig = dbConfig;
  }

  protected void initMySqlDbConfig() {

    DataBase dataBase = this.selectedDatabase;
    // OraclePaginationImpl
    Pagination pagination = (Pagination) ReflectUtil.instantiate(dataBase.getPaginationImpl());
    DbConfig dbConfig = new DbConfig();
    dbConfig.setDbType(DbType.ORACLE);
    dbConfig.setPagination(pagination);
    dbConfig.setKeyword("?");
View Full Code Here

    this.dbConfig = dbConfig;
  }

  protected void initDB2DbConfig() {
    DataBase dataBase = this.selectedDatabase;
    // OraclePaginationImpl
    Pagination pagination = (Pagination) ReflectUtil.instantiate(dataBase.getPaginationImpl());
    DbConfig dbConfig = new DbConfig();
    dbConfig.setDbType(DbType.ORACLE);
    dbConfig.setPagination(pagination);
    dbConfig.setKeyword("?");
View Full Code Here

    this.dbConfig = dbConfig;
  }

  protected void initOracleDbConfig() {
    DataBase dataBase = this.selectedDatabase;
    // OraclePaginationImpl
    Pagination pagination = (Pagination) ReflectUtil.instantiate(dataBase.getPaginationImpl());
    DbConfig dbConfig = new DbConfig();
    dbConfig.setDbType(DbType.ORACLE);
    dbConfig.setPagination(pagination);
    dbConfig.setKeyword("?");
View Full Code Here

TOP

Related Classes of com.founder.fix.bpmn2extensions.coreconfig.DataBase

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.