Package org.pentaho.commons.connection

Examples of org.pentaho.commons.connection.IPentahoResultSet


    if ( !( obj2 instanceof IPentahoResultSet ) ) {
      error( Messages.getInstance().getErrorString( "ResultSetCompareComponent.ERROR_0005_INPUT_RS2_NOT_RS" ) ); //$NON-NLS-1$
      return false;
    }

    IPentahoResultSet rs1 = (IPentahoResultSet) compareAction.getResultSet1().getValue();
    IPentahoResultSet rs2 = (IPentahoResultSet) compareAction.getResultSet2().getValue();

    String tempOutputMismatches = compareAction.getOutputMismatches().getStringValue();
    boolean outputMismatches = false;
    if ( ( tempOutputMismatches != null ) && tempOutputMismatches.trim().toLowerCase().equals( "true" ) ) { //$NON-NLS-1$
      outputMismatches = true;
View Full Code Here


  @Override
  protected boolean executeAction() {
    Object resultSetObject = getInputValue( ResultSetFlattenerComponent.RESULT_SET );
    if ( resultSetObject instanceof IPentahoResultSet ) {
      IPentahoResultSet resultset = (IPentahoResultSet) resultSetObject;
      int column = (int) getInputLongValue( ResultSetFlattenerComponent.FLATTEN_COLUMN, 0 );
      column--;
      if ( getResultOutputName() != null ) {
        setOutputValue( getResultOutputName(), PentahoDataTransmuter.flattenResultSet( resultset, column ) );
      }
View Full Code Here

      if ( ComponentBase.debug ) {
        debug( Messages.getInstance().getString( "HQLBaseComponent.DEBUG_RUNNING_QUERY", query ) ); //$NON-NLS-1$
      }

      // evaluate
      IPentahoResultSet resultSet = connection.executeQuery( query );
      rSet = resultSet;
      return resultSet;
    } catch ( Exception e ) {
      error( Messages.getInstance().getErrorString( "HQLBaseComponent.ERROR_00012_EXECUTE_FAILED", getActionName() ), e ); //$NON-NLS-1$
    }
View Full Code Here

      connection =
          PentahoConnectionFactory.getConnection( IPentahoConnection.SQL_DATASOURCE, jndiName, getSession(), this );
    }
    String query = ReportParameterUtility.setupParametersForActionSequence( reportSpec.getQuery() );
    query = setupQueryParameters( query );
    IPentahoResultSet res = connection.executeQuery( query );
    return res;
  }
View Full Code Here

    assertFalse( actualResult2 );
  }

  private static IActionParameter createParameterWithResult( int rowsCount ) {
    IActionParameter parameter = mock( IActionParameter.class );
    IPentahoResultSet resultSet = mock( IPentahoResultSet.class );
    when( resultSet.getRowCount() ).thenReturn( rowsCount );
    when( parameter.getValue() ).thenReturn( resultSet );
    return parameter;
  }
View Full Code Here

          dataComponent.setMessages( getMessages() );
          // if that fails, then we know we messed up again.
          // Abort, we cant continue anyway.
          if ( ( dataComponent.validate() == IRuntimeContext.RUNTIME_CONTEXT_VALIDATE_OK ) && dataComponent.init()
              && ( dataComponent.execute() == IRuntimeContext.RUNTIME_STATUS_SUCCESS ) ) {
            final IPentahoResultSet resultset = dataComponent.getResultSet();
            factory =
                new PentahoTableDataFactory( AbstractJFreeReportComponent.DATACOMPONENT_DEFAULTINPUT,
                    new PentahoTableModel( resultset ) );
          } else {
            throw new IllegalArgumentException( Messages.getInstance().getErrorString(
View Full Code Here

        }
        if ( dataObject instanceof IPreparedComponent ) {
          final IPreparedComponent comp = (IPreparedComponent) dataObject;
          factory.addPreparedComponent( name, comp );
        } else if ( dataObject instanceof IPentahoResultSet ) {
          final IPentahoResultSet resultset = (IPentahoResultSet) dataObject;
          resultset.beforeFirst();
          factory.addTable( name, new PentahoTableModel( resultset ) );
        } else if ( dataObject instanceof TableModel ) {
          final TableModel model = (TableModel) dataObject;
          factory.addTable( name, model );
        }
View Full Code Here

          String[] columnNames = parameters.getColumnNames();
          for ( String columnName : columnNames ) {
            map.put( columnName, parameters.get( columnName ) );
          }
        }
        final IPentahoResultSet rs = component.executePrepared( map );
        model = new PentahoTableModel( rs );
      }
    }
    return model;
  }
View Full Code Here

                      userSession, logger );

              try {
                query =
                    TemplateUtil.applyTemplate( query, TemplateUtil.parametersToProperties( parameterProvider ), null );
                IPentahoResultSet results = connection.executeQuery( query );
                chartComponent.setValues( results );
              } finally {
                boolean ignored = true;
              }
View Full Code Here

    IPentahoConnection connection =
        PentahoConnectionFactory.getConnection( IPentahoConnection.MDX_DATASOURCE, mdxProperties, session, this );
    // @TODO Need to know how to use this getConnection method. Where does this property name comes from

    try {
      IPentahoResultSet results = connection.executeQuery( "select * from DEPARTMENT_MANAGERS" ); //$NON-NLS-1$
      Object[][] columnHeaders = results.getMetaData().getColumnHeaders();
      for ( int row = 0; row < columnHeaders.length; row++ ) {
        for ( int col = 0; col < columnHeaders[0].length; col++ ) {
          outputStream.write( columnHeaders[row][col].toString().getBytes() );
          outputStream.write( ",".getBytes() ); //$NON-NLS-1$
        }
        outputStream.write( "\n".getBytes() ); //$NON-NLS-1$
      }
      Object[] row = results.next();
      while ( row != null ) {
        for ( int i = 0; i < row.length; i++ ) {
          outputStream.write( row[i].toString().getBytes() );
          outputStream.write( ",".getBytes() ); //$NON-NLS-1$
        }
        outputStream.write( "\n".getBytes() ); //$NON-NLS-1$
        row = results.next();
      }

    } catch ( Exception e ) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.pentaho.commons.connection.IPentahoResultSet

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.