Package org.pentaho.commons.connection.memory

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


    metadata.setColumnTypes( new String[] { "string", "int" } );

    MemoryResultSet data = new MemoryResultSet( metadata );

    data.addRow( new Object[] { "a", new Integer( 1 ) } );
    data.addRow( new Object[] { "b", new Integer( 2 ) } );
    data.addRow( new Object[] { "c", new Integer( 3 ) } );

    MarshallableResultSet result = new MarshallableResultSet();
    result.setResultSet( data );
View Full Code Here


    metadata.setColumnTypes( new String[] { "string", "int" } );

    MemoryResultSet data = new MemoryResultSet( metadata );

    data.addRow( new Object[] { "a", new Integer( 1 ) } );
    data.addRow( new Object[] { "b", new Integer( 2 ) } );
    data.addRow( new Object[] { "c", new Integer( 3 ) } );

    MarshallableResultSet result = new MarshallableResultSet();
    result.setResultSet( data );
    validate( result );
View Full Code Here

        }

        // Its OK if there is no min and max - we will derive it later if absent.
        MemoryResultSet set = new MemoryResultSet();
        if ( ( min == -1 ) && ( max == -1 ) ) {
          set.addRow( new Object[] { new Double( val ) } );
        } else {
          set.addRow( new Object[] { new Double( val ), new Double( min ), new Double( max ) } );
        }
        values = set;
      }
View Full Code Here

        // Its OK if there is no min and max - we will derive it later if absent.
        MemoryResultSet set = new MemoryResultSet();
        if ( ( min == -1 ) && ( max == -1 ) ) {
          set.addRow( new Object[] { new Double( val ) } );
        } else {
          set.addRow( new Object[] { new Double( val ), new Double( min ), new Double( max ) } );
        }
        values = set;
      }
    }
View Full Code Here

    MemoryResultSet data = new MemoryResultSet( metadata );

    data.addRow( new Object[] { "a", new Integer( 1 ) } );
    data.addRow( new Object[] { "b", new Integer( 2 ) } );
    data.addRow( new Object[] { "c", new Integer( 3 ) } );

    MarshallableResultSet result = new MarshallableResultSet();
    result.setResultSet( data );
    validate( result );
View Full Code Here

  public void testCopyMemoryResultSet() {
    MemoryMetaData metadata = new MemoryMetaData( new String[][] { { "col1", "col2" } }, null );

    MemoryResultSet data1 = new MemoryResultSet( metadata );

    data1.addRow( new Object[] { "a", new Integer( 1 ) } );
    data1.addRow( new Object[] { "b", new Integer( 2 ) } );
    data1.addRow( new Object[] { "c", new Integer( 3 ) } );

    MemoryResultSet data = (MemoryResultSet) data1.memoryCopy();
View Full Code Here

    MemoryMetaData metadata = new MemoryMetaData( new String[][] { { "col1", "col2" } }, null );

    MemoryResultSet data1 = new MemoryResultSet( metadata );

    data1.addRow( new Object[] { "a", new Integer( 1 ) } );
    data1.addRow( new Object[] { "b", new Integer( 2 ) } );
    data1.addRow( new Object[] { "c", new Integer( 3 ) } );

    MemoryResultSet data = (MemoryResultSet) data1.memoryCopy();

    assertNotNull( data.getMetaData() );
View Full Code Here

    MemoryResultSet data1 = new MemoryResultSet( metadata );

    data1.addRow( new Object[] { "a", new Integer( 1 ) } );
    data1.addRow( new Object[] { "b", new Integer( 2 ) } );
    data1.addRow( new Object[] { "c", new Integer( 3 ) } );

    MemoryResultSet data = (MemoryResultSet) data1.memoryCopy();

    assertNotNull( data.getMetaData() );
    assertNotNull( data.getMetaData().getColumnHeaders() );
View Full Code Here

      cachedMetaData.setColumnTypes( columnTypeClones );

      MemoryResultSet cachedResultSet = new MemoryResultSet( cachedMetaData );
      Object[] rowObjects = next();
      while ( rowObjects != null ) {
        cachedResultSet.addRow( rowObjects );
        rowObjects = next();
      }
      return cachedResultSet;
    } finally {
      close();
View Full Code Here

      Object[][] columnHeaders = localMetadata.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.