Package org.pentaho.commons.connection.memory

Examples of org.pentaho.commons.connection.memory.MemoryResultSet.addRow()


    }

    IPentahoMetaData metaData = new MemoryMetaData( columnHeaders, rowHeaders );
    MemoryResultSet result = new MemoryResultSet( metaData );
    for ( int i = 0; i < data.size(); i++ ) {
      result.addRow( ( (List) data.get( i ) ).toArray() );
    }
    return result;
  }

  public static Node getChartNode( String xml ) {
View Full Code Here


      if ( resultSet != null && !live && executor.isLive() ) {
        // read the results and cache them
        MemoryResultSet cachedResultSet = new MemoryResultSet( resultSet.getMetaData() );
        Object[] rowObjects = resultSet.next();
        while ( rowObjects != null ) {
          cachedResultSet.addRow( rowObjects );
          rowObjects = resultSet.next();
        }
        resultSet.close();
        resultSet.closeConnection();
        resultSet = cachedResultSet;
View Full Code Here

    resultSet = new MemoryResultSet( metadata );

    Object[] rowObjects = new Object[1];
    rowObjects[0] = new Integer( n );
    resultSet.addRow( rowObjects );
    return resultSet;

  }

}
View Full Code Here

        if ( ComponentBase.debug ) {
          debug( Messages.getInstance().getString( "SQLBaseComponent.DEBUG_RUNNING_QUERY", query ) ); //$NON-NLS-1$
        }
        int affectedRows = conn.execute( query );
        executed = true;
        affectedRowsResultSet.addRow( new Object[] { new Integer( affectedRows ), successMsg } );
      } else {
        //
        // Multiple statement execute support provided by contribution from Melanie Crouch
        //
        rawQuery = SQLExecute.removeLineTerminators( rawQuery.trim() ).toString();
View Full Code Here

          }
          try {
            int affectedRows = conn.execute( query );
            // Normally, we'd check to see if the execution resulted in
            // some updated rows.
            affectedRowsResultSet.addRow( new Object[] { new Integer( affectedRows ), successMsg } );
            executed = true;
            debug( Messages.getInstance().getString( "SQLBaseComponent.DEBUG_UPDATED_QUERY", query ) ); //$NON-NLS-1$
          } catch ( SQLException e ) {
            error( Messages.getInstance().getErrorString(
                "SQLBaseComponent.ERROR_0006_EXECUTE_FAILED", getActionName() + " : " + e.getLocalizedMessage() ) ); //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

  private IPentahoResultSet getResultSet() {
    Object[][] columnHeaders = new Object[][] { { "COL1", "COL2", "COL3" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    IPentahoMetaData md = new MemoryMetaData( columnHeaders, null );
    MemoryResultSet rs = new MemoryResultSet( md );
    rs.addRow( new Object[] { "DATA1", "DATA2", new Date() } ); //$NON-NLS-1$ //$NON-NLS-2$
    rs.isScrollable();
    return rs;
  }

  private IPentahoResultSet getResultSetFromArray() {
View Full Code Here

    columnHeadersList.add( "COL3" ); //$NON-NLS-1$
    MemoryMetaData md2 = new MemoryMetaData( columnHeaders, null );
    //    emd.getAttribute(1, 1, "COL1"); //$NON-NLS-1$
    // emd.setBusinessColumns(columnHeadersList);
    MemoryResultSet rs = new MemoryResultSet( md2 );
    rs.addRow( new Object[] { "DATA1", "DATA2", new Date() } ); //$NON-NLS-1$ //$NON-NLS-2$
    return rs;
  }

  private IPentahoResultSet getResultSet3() {
    List columnHeadersList = new ArrayList();
View Full Code Here

    columnHeadersList.add( "COL1" ); //$NON-NLS-1$
    columnHeadersList.add( "COL2" ); //$NON-NLS-1$
    columnHeadersList.add( "COL3" ); //$NON-NLS-1$
    MemoryMetaData md3 = new MemoryMetaData( columnHeadersList );
    MemoryResultSet rs = new MemoryResultSet( md3 );
    rs.addRow( new Object[] { "DATA1", "DATA2", new Date() } ); //$NON-NLS-1$ //$NON-NLS-2$
    return rs;
  }

  public void testHelloWorldComponent() {
    startTest();
View Full Code Here

      MemoryResultSet resultSet = new MemoryResultSet();
      MemoryMetaData metaData = new MemoryMetaData( columnHeaders, rowHeaders );
      resultSet.setMetaData( metaData );
      for ( Object[] element : data ) {
        resultSet.addRow( element );
      }
      rSet = resultSet;
      if ( resultSet != null ) {
        if ( getResultOutputName() != null ) {
          setOutputValue( getResultOutputName(), resultSet );
View Full Code Here

      Object[][] columnHeaders = meta.getColumnHeaders();
      MemoryMetaData cachedMetaData = new MemoryMetaData( columnHeaders, null );
      MemoryResultSet cachedResultSet = new MemoryResultSet( cachedMetaData );
      Object[] rowObjects = next();
      while ( rowObjects != null ) {
        cachedResultSet.addRow( rowObjects );
        rowObjects = next();
      }
      return cachedResultSet;
    } finally {
      close();
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.