Package it.eng.spago.dbaccess.sql.result

Examples of it.eng.spago.dbaccess.sql.result.ScrollableDataResult


        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);
      }
      return result;
    }
View Full Code Here


      DataSourceUtilities dsUtil = new DataSourceUtilities();
      Connection conn = dsUtil.getConnection(profile,dataSource);
      dataConnection = dsUtil.getDataConnection(conn);
      sqlCommand = dataConnection.createSelectCommand(statement, false);
      dataResult = sqlCommand.execute();
      ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult.getDataObject();
      SourceBean result = scrollableDataResult.getSourceBean();
      resStr = result.toXML(false);
      resStr = resStr.trim();
      if(resStr.startsWith("<?")) {
        resStr = resStr.substring(2);
        int indFirstTag = resStr.indexOf("<");
View Full Code Here

      DataSourceUtilities dsUtil = new DataSourceUtilities();
      Connection conn = dsUtil.getConnection(profile,dataSource);
      dataConnection = dsUtil.getDataConnection(conn);
      sqlCommand = dataConnection.createSelectCommand(statement, false);
      dataResult = sqlCommand.execute();
      ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult.getDataObject();
      result = scrollableDataResult.getSourceBean();
    } finally {
      Utils.releaseResources(dataConnection, sqlCommand, dataResult);
    }

    // START converting the SourceBean into a string and then into SourceBean again:
View Full Code Here

      Connection conn = dsUtil.getConnection(requestContainer,datasource);
      dataConnection = dsUtil.getDataConnection(conn);

      sqlCommand = dataConnection.createSelectCommand(statement, false);
      dataResult = sqlCommand.execute();
      ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult
          .getDataObject();
      List temp = Arrays.asList(scrollableDataResult.getColumnNames());
      columnsNames.addAll(temp);
      result = scrollableDataResult.getSourceBean();
    } finally {
      Utils.releaseResources(dataConnection, sqlCommand, dataResult);
    }
    return result;
  }
View Full Code Here

      logger.debug("IN");
      DataStore dataStore;
      DataStoreMetaData dataStoreMeta;
      FieldMetadata fieldMeta;
     
      ScrollableDataResult scrollableDataResult;
      List columnsNames;
      SourceBean resultSB;
     
     
      try {
     
        scrollableDataResult = (ScrollableDataResult)data;
       
        dataStore = new DataStore();
        dataStoreMeta = new DataStoreMetaData();
       
        logger.debug("Reading dataStore metadata ...");
        columnsNames = Arrays.asList(scrollableDataResult.getColumnNames());
        for(int i = 0; i < columnsNames.size(); i++) {
          fieldMeta = new FieldMetadata();
          fieldMeta.setName( (String)columnsNames.get(i) );
          dataStoreMeta.addFiedMeta(fieldMeta);
          logger.debug("Field [" + (i+1) + "] name is equak to [" + fieldMeta.getName() + "]");
        }     
      dataStore.setMetaData(dataStoreMeta);
      logger.debug("dataStore metadata read succefully");
     
      try {
        resultSB = scrollableDataResult.getSourceBean();
      } catch(Throwable t ) {
        throw new RuntimeException("Impossible to extract xml data", t);
     
      if( resultSB != null) {
        List rows;
View Full Code Here

    // get CHECKED_QUERY statment
    String statement = getQueryStatement("CHECKED_QUERY", parameters);

    // exec CHECKED_QUERY
    ScrollableDataResult scrollableDataResult = null;
    SQLCommand sqlCommand = null;
    DataConnection dataConnection = null;
    DataResult dataResult = null;
    String pool = null;
    try {
      pool = (String) config.getAttribute("POOL");
      dataConnection = DataConnectionManager.getInstance().getConnection(
          pool);
      sqlCommand = dataConnection.createSelectCommand(statement);
      dataResult = sqlCommand.execute();
      scrollableDataResult = (ScrollableDataResult) dataResult
          .getDataObject();
      SourceBean chekedObjectsBean = scrollableDataResult.getSourceBean();
      List checkedObjectsList = chekedObjectsBean
          .getAttributeAsList("ROW");

      String tmpElements = (request.getAttribute("checkedElements")==null)?"":(String)request.getAttribute("checkedElements");
        String[] arrElements = tmpElements.split(",");
View Full Code Here

    try {
      dataConnectionManager = DataConnectionManager.getInstance();
      dataConnection = dataConnectionManager.getConnection(pool);
      sqlCommand = dataConnection.createSelectCommand(statement);
      dataResult = sqlCommand.execute();
      ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult
          .getDataObject();
      result = scrollableDataResult.getSourceBean();
    } catch (Exception ex) {
      TracerSingleton.log(Constants.NOME_MODULO,
          TracerSingleton.CRITICAL, "executeSelect:", ex);
    } finally {
      Utils.releaseResources(dataConnection, sqlCommand, dataResult);
View Full Code Here

    Session aSession = null;
    Transaction tx = null;
   
    // exec CHECKED_QUERY
    ScrollableDataResult scrollableDataResult = null;
    SQLCommand sqlCommand = null;
    DataConnection dataConnection = null;
    DataResult dataResult = null;
    try {
      aSession = HibernateUtil.currentSession();
      tx = aSession.beginTransaction();
      Connection jdbcConnection = aSession.connection();
      dataConnection = DelegatedHibernateConnectionListService.getDataConnection(jdbcConnection);
          sqlCommand = dataConnection.createSelectCommand(statement);
          dataResult = sqlCommand.execute();
          scrollableDataResult = (ScrollableDataResult) dataResult.getDataObject();
      SourceBean chekedObjectsBean = scrollableDataResult.getSourceBean();
      List checkedObjectsList = chekedObjectsBean
          .getAttributeAsList("ROW");
      for (int i = 0; i < checkedObjectsList.size(); i++) {
        SourceBean objects = (SourceBean) checkedObjectsList.get(i);
        String key = getObjectKey(objects);
View Full Code Here

            if ((inputParameters != null) && (inputParameters.size() != 0)) {
                dataResult = sqlCommand.execute(inputParameters);
            } else
                dataResult = sqlCommand.execute();
            if (type.equalsIgnoreCase("SELECT")) {
                ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult
                        .getDataObject();
                result = scrollableDataResult.getSourceBean();
            } // if (type.equalsIgnoreCase("SELECT"))
            else {
                InformationDataResult informationDataResult = (InformationDataResult) dataResult
                        .getDataObject();
                result = new Boolean(informationDataResult.getAffectedRows() > 0);
View Full Code Here

      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);
      logger.debug("OUT");
  }
  return result;
View Full Code Here

TOP

Related Classes of it.eng.spago.dbaccess.sql.result.ScrollableDataResult

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.