Package org.pentaho.commons.connection

Examples of org.pentaho.commons.connection.IPentahoResultSet


    component.execute();

    // Postprocessor test code will add condition changing
    // resultset to 10 rows, all contactfirstnames starting with 'A'

    IPentahoResultSet rs = component.getResultSet();
    try {
      Assert.assertNotNull( rs );
      Assert.assertEquals( 10, rs.getRowCount() );
      Object[] obj;
      while ( ( obj = rs.next() ) != null ) {
        System.out.println( obj[0] );
      }

    } finally {
      rs.close();
      rs.closeConnection();
    }
  }
View Full Code Here


    MetadataQueryComponent component = new MetadataQueryComponent();
    component.setQuery( mql );
    component.execute();

    IPentahoResultSet rs = component.getResultSet();
    try {
      Assert.assertNotNull( rs );
      Assert.assertEquals( 1, rs.getColumnCount() );
      Assert.assertEquals( 122, rs.getRowCount() );
      Object[] obj;
      while ( ( obj = rs.next() ) != null ) {
        System.out.println( obj[0] );
      }

    } finally {
      if ( rs != null ) {
        rs.close();
        rs.closeConnection();
      }
    }
  }
View Full Code Here

        row.add( value );
      }
      data.add( row );
    }

    IPentahoResultSet resultSet = MemoryResultSet.createFromLists( colHeaders, data );

    return resultSet;
  }
View Full Code Here

    component.setQuery( mql );
    boolean result = component.execute();

    Assert.assertTrue( result );

    IPentahoResultSet rs = component.getResultSet();
    try {
      Assert.assertNotNull( rs );
      Assert.assertEquals( 1, rs.getColumnCount() );
      Assert.assertEquals( 122, rs.getRowCount() );
      Object[] obj;
      while ( ( obj = rs.next() ) != null ) {
        System.out.println( obj[0] );
      }

    } finally {
      if ( rs != null ) {
        rs.close();
        rs.closeConnection();
      }
    }

    // second, test with forceDb = true
View Full Code Here

    finishTest();
  }

  public void testDataUtility() {
    startTest();
    IPentahoResultSet rs = getResultSet();
    String xmlString = DataUtilities.getXMLString( rs );
    assertTrue( xmlString.indexOf( "DATA2" ) > 0 ); //$NON-NLS-1$
    finishTest();
  }
View Full Code Here

    finishTest();
  }

  public void testDataUtility1() {
    startTest();
    IPentahoResultSet rs1 = getResultSetFromArray();
    String xmlString1 = DataUtilities.getXMLString( rs1 );
    assertTrue( xmlString1.indexOf( "VAL1" ) > 0 ); //$NON-NLS-1$
    finishTest();
  }
View Full Code Here

    finishTest();
  }

  public void testDataUtility3() {
    startTest();
    IPentahoResultSet rs3 = getResultSet2();
    String xmlString3 = DataUtilities.getXMLString( rs3 );
    assertTrue( xmlString3.indexOf( "DATA2" ) > 0 ); //$NON-NLS-1$

    finishTest();
  }
View Full Code Here

    finishTest();
  }

  public void testDataUtility4() {
    startTest();
    IPentahoResultSet rs4 = getResultSet3();
    String xmlString4 = DataUtilities.getXMLString( rs4 );
    assertTrue( xmlString4.indexOf( "DATA2" ) > 0 ); //$NON-NLS-1$  
    finishTest();
  }
View Full Code Here

  protected boolean executeAction() {
    int height = -1;
    int width = -1;
    String title = ""; //$NON-NLS-1$
    Node chartDocument = null;
    IPentahoResultSet data = (IPentahoResultSet) getInputValue( ChartComponent.CHART_DATA_PROP );
    if ( !data.isScrollable() ) {
      getLogger().debug( "ResultSet is not scrollable. Copying into memory" ); //$NON-NLS-1$
      IPentahoResultSet memSet = data.memoryCopy();
      data.close();
      data = memSet;
    }

    String urlTemplate = (String) getInputValue( ChartComponent.URL_TEMPLATE );
View Full Code Here

  protected boolean executeAction() {
    log.debug( "start to run open flash chart component......" ); //$NON-NLS-1$

    // input data

    IPentahoResultSet data = (IPentahoResultSet) getInputValue( CHART_DATA );
    if ( !data.isScrollable() ) {
      getLogger().debug( "ResultSet is not scrollable. Copying into memory" ); //$NON-NLS-1$
      IPentahoResultSet memSet = data.memoryCopy();
      data.close();
      data = memSet;
    }
    // chart width
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.