Package org.pentaho.commons.connection.memory

Examples of org.pentaho.commons.connection.memory.MemoryMetaData


    Object[][] rowHeaders = new String[rHeaders.size()][1];
    for ( int i = 0; i < rHeaders.size(); i++ ) {
      rowHeaders[i][0] = rHeaders.get( i );
    }

    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;
View Full Code Here


    MemoryResultSet resultSet = null;
    int n = ( (SQLConnection) connection ).execute( query );

    Object[][] columnHeaders = new Object[1][1];
    columnHeaders[0][0] = "result"; //$NON-NLS-1$
    IPentahoMetaData metadata = new MemoryMetaData( columnHeaders, null );

    resultSet = new MemoryResultSet( metadata );

    Object[] rowObjects = new Object[1];
    rowObjects[0] = new Integer( n );
View Full Code Here

    boolean continueOnException = sqlExecuteAction.getContinueOnException().getBooleanValue( false );
    String[] columnHeaders =
        new String[] { Messages.getInstance().getString( "SQLExecute.USER_AFFECTED_ROWS_COLUMN_NAME" ), //$NON-NLS-1$
          Messages.getInstance().getString( "SQLExecute.USER_AFFECTED_ROW_STATUS" ) //$NON-NLS-1$
        };
    MemoryMetaData metaData = new MemoryMetaData( new String[][] { columnHeaders }, null );
    metaData.setColumnTypes( new String[] { "int", "string" } ); //$NON-NLS-1$ //$NON-NLS-2$
    MemoryResultSet affectedRowsResultSet = new MemoryResultSet( metaData );
    String successMsg = Messages.getInstance().getString( "SQLExecute.USER_SUCCESS" ); //$NON-NLS-1$
    String failMsg = Messages.getInstance().getString( "SQLExecute.USER_FAILED" ); //$NON-NLS-1$
    try {
      if ( conn == null ) {
View Full Code Here

    List<String> cols = new ArrayList<String>();
    cols.add( "MESES" );
    cols.add( "ACTUAL" );
    cols.add( "ANTERIOR" );

    query_result.setMetaData( new MemoryMetaData( cols ) );
    query_result.addRow( new Object[] { "Enero", 0, 0 } );
    query_result.addRow( new Object[] { "Febrero", 0, 0 } );
    query_result.addRow( new Object[] { "Marzo", 0, 0 } );
    query_result.addRow( new Object[] { "Abril", 0, 0 } );
    query_result.addRow( new Object[] { "Mayo", 0, 0 } );
View Full Code Here

    return outputHandler;
  }

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

    Object[][] columnHeaders = new Object[][] { { "COL1", "COL2", "COL3" } }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    List columnHeadersList = new ArrayList();
    columnHeadersList.add( "COL1" ); //$NON-NLS-1$
    columnHeadersList.add( "COL2" ); //$NON-NLS-1$
    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;
View Full Code Here

  private IPentahoResultSet getResultSet3() {
    List columnHeadersList = new ArrayList();
    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;
  }
View Full Code Here

            }
            if ( ComponentBase.debug ) {
              debug( Messages.getInstance().getString( "Kettle.DEBUG_CREATING_RESULTSET_METADATA" ) ); //$NON-NLS-1$
            }

            MemoryMetaData metaData = new MemoryMetaData( columns, null );
            results = new MemoryResultSet( metaData );
            errorResults = new MemoryResultSet( metaData );

            // add ourself as a row listener
            step.step.addRowListener( this );
View Full Code Here

        data[ rowLoc ][ columnLoc ] = value;
      } // CellLoop

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

  protected IPentahoMetaData getMetadata( final IPentahoResultSet resultSet, final boolean live ) {
    if ( live ) {
      return resultSet.getMetaData();
    } else {
      Object[][] columnHeaders = resultSet.getMetaData().getColumnHeaders();
      return new MemoryMetaData( columnHeaders, null );
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.commons.connection.memory.MemoryMetaData

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.