Examples of SqlCommand


Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

     
      String sqlText=getUserInfoConfig().getSqlText();
     
     

      SqlCommand sqlCommand = getSqlCommand();

      List<Object> objectParamWhere = new ArrayList<Object>();

      objectParamWhere.add(userId);

      List<Map<String, Object>> dataObj = sqlCommand.queryForList("SELECT USERTABLE.* FROM ("+sqlText+") USERTABLE where USERTABLE."+userIdField+"=?", objectParamWhere);

      if(dataObj.size()==0){
        return null;
      }
     
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

    Map<String,Object> resultMap = new HashMap<String,Object>();
    List<UserTo> resultList = new ArrayList<UserTo>();
    String userIdField=getUserInfoConfig().getUserIdField();
    String userNameField=getUserInfoConfig().getUserNameField();
    String sqlText=getUserInfoConfig().getSqlText();
    SqlCommand sqlCommand = getSqlCommand();
    String sql = "SELECT USERTABLE.* FROM ("+sqlText+") USERTABLE WHERE 1=1";
    String countSql = "SELECT count(*) FROM ("+sqlText+") USERTABLE WHERE 1=1";
    String whereSql = "";
    if(queryMap != null && queryMap.containsKey("USERID")){
      whereSql += " AND "+userIdField+" LIKE '%"+queryMap.get("USERID")+"%'";
    }
    if(queryMap != null && queryMap.containsKey("USERNAME")){
      whereSql += " AND "+userNameField+" LIKE '%"+queryMap.get("USERNAME")+"%' ";
    }
    sql += whereSql;
    countSql += whereSql;
   
    int count = Integer.parseInt(sqlCommand.queryForValue(countSql).toString());
    if (page != null) {
      Pagination pagination = Context.getProcessEngineConfiguration().getDbConfig().getPagination();
      sql = pagination.getPaginationSql(sql, page.getFirstResult(), page.getMaxResults(), "*",null);
    }
    List<Map<String, Object>> dataObj = sqlCommand.queryForList(sql, null);
   
    for(int i= 0;i<dataObj.size();i++){
      if (dataObj.get(i).get(userIdField) != null) {
        UserTo userTo = new UserTo(StringUtil.getString(dataObj.get(i).get(userIdField)), StringUtil.getString(dataObj.get(i).get(userNameField)), dataObj.get(i));
        resultList.add(userTo);
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

  private java.lang.String table;

  private java.util.HashMap param;

  public void execute(ExecutionContext executionContext) throws Exception {
    SqlCommand sqlCommand=executionContext.getSqlCommand();
    // 构建查询参数
    HashMap<String, Object> objectParam = (HashMap<String, Object>)param;
    // 执行插入语句
    sqlCommand.insert(table, objectParam);
  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

   
    try {
      ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
      interpreter.set("sysRulesConfig", Context.getProcessEngineConfiguration());
      interpreter.set("parameter", parameter);
      interpreter.set("sqlCommand", new SqlCommand(Context.getDbConnection()));
      if(configMap!=null){
       
        for (String mapKey : configMap.keySet()) {
          interpreter.set(mapKey, configMap.get(mapKey));
        }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

  public Object executeBusinessRules(String ruleId, Object parameter, Map<String, Object> configMap) {
    try {
      ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
      interpreter.set("sysRulesConfig", Context.getProcessEngineConfiguration());
      interpreter.set("parameter", parameter);
      interpreter.set("sqlCommand", new SqlCommand(Context.getDbConnection()));
      if(configMap!=null){
       
        for (String mapKey : configMap.keySet()) {
          interpreter.set(mapKey, configMap.get(mapKey));
        }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

  public static List<Map<String, Object>> getDataValueAll(String dataBaseId, String bizkey, String field, ExecutionContext executionContext) {
    List<Object> paramList = new ArrayList<Object>();
    paramList.add(bizkey);
    String bizObjName = StringUtil.getString(ExpressionMgmt.execute("Fix_BizName", executionContext));
    String bizField = StringUtil.getString(ExpressionMgmt.execute("Fix_BizKeyFile", executionContext));
    SqlCommand sqlCommand = new SqlCommand(Context.getDbConnection(dataBaseId));
    List<Map<String, Object>> dataObjList = sqlCommand.queryForList("SELECT " + field + " FROM " + bizObjName + " WHERE " + bizField + "=?", paramList);

    return dataObjList;

  }
View Full Code Here

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand

  public static Object getDataValue(String dataBaseId, String bizkey, String field, ExecutionContext executionContext) {
    List<Object> paramList = new ArrayList<Object>();
    paramList.add(bizkey);
    String bizObjName = StringUtil.getString(ExpressionMgmt.execute("Fix_BizName", executionContext));
    String bizField = StringUtil.getString(ExpressionMgmt.execute("Fix_BizKeyFile", executionContext));
    SqlCommand sqlCommand = new SqlCommand(Context.getDbConnection(dataBaseId));
    List<Map<String, Object>> dataObjList = sqlCommand.queryForList("SELECT " + field + " FROM " + bizObjName + " WHERE " + bizField + "=?", paramList);
    if (dataObjList.size() == 0) {
      return null;
    } else {
      return dataObjList.get(0).get(field);
    }
View Full Code Here

Examples of henplus.commands.SQLCommand

        _dispatcher.register(_objectLister);
        _dispatcher.register(new DescribeCommand(_objectLister));

        _dispatcher.register(new TreeCommand(_objectLister));

        _dispatcher.register(new SQLCommand(_objectLister, _henplusProperties));

        _dispatcher.register(new ImportCommand(_objectLister));
        // _dispatcher.register(new ExportCommand());
        _dispatcher.register(new DumpCommand(_objectLister, loadCommand));
View Full Code Here

Examples of it.eng.spago.dbaccess.sql.SQLCommand

   * @param domainCode  The Domain code String
   * @param valueCode  The domain Value Dtring
   * @return  The Domain ID
   */
    private Integer findSBIDomainValueID(String domainCode, String valueCode ){
      SQLCommand cmd = null;
    DataResult dr = null;
    DataConnection dataConnection = null;
    Integer returnValue = null;
    try {
      IDomainDAO domdao = DAOFactory.getDomainDAO();
View Full Code Here

Examples of it.eng.spago.dbaccess.sql.SQLCommand

     public static Object executeSelect(RequestContainer requestContainer,
        ResponseContainer responseContainer, String datasource, String statement) throws EMFInternalError {
      Object result = null;
      DataConnectionManager dataConnectionManager = null;
      DataConnection dataConnection = null;
      SQLCommand sqlCommand = null;
      DataResult dataResult = null;
      try {
        //dataConnectionManager = DataConnectionManager.getInstance();
        //dataConnection = dataConnectionManager.getConnection(pool);
        DataSourceUtilities dsUtil = new DataSourceUtilities();
        Connection conn = dsUtil.getConnection(requestContainer,datasource);
        dataConnection = dsUtil.getDataConnection(conn);

        sqlCommand = dataConnection.createSelectCommand(statement);
        dataResult = sqlCommand.execute();
        ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult
            .getDataObject();
        result = scrollableDataResult.getSourceBean();
      } finally {
        Utils.releaseResources(dataConnection, sqlCommand, dataResult);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.