Package org.pentaho.commons.connection

Examples of org.pentaho.commons.connection.IPentahoMetaData


    defaultValue = value;
    resultSet = getResultSet( parameterProviders );
    if ( resultSet != null ) {
      // find the column that we have been told to you
      IPentahoMetaData metaData = resultSet.getMetaData();
      nameColumnNo = metaData.getColumnIndex( descriptionItem );
      valueColumnNo = metaData.getColumnIndex( valueItem );
    }
    return ( resultSet != null );
  }
View Full Code Here


    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

  private void setReportConfigParameters( final MasterReport report, final IPentahoResultSet values ) {
    int rowCount = values.getRowCount();
    int colCount = values.getColumnCount();
    ModifiableConfiguration config = report.getReportConfiguration();
    if ( colCount >= 2 ) {
      IPentahoMetaData md = values.getMetaData();
      int nameIdx = md.getColumnIndex( "name" ); //$NON-NLS-1$
      int valIdx = md.getColumnIndex( "value" ); //$NON-NLS-1$
      if ( nameIdx < 0 ) {
        nameIdx = 0;
      }
      if ( valIdx < 0 ) {
        valIdx = 1;
View Full Code Here

            }
          } else if ( parameterValue instanceof IPentahoResultSet ) {
            IPentahoResultSet rs = (IPentahoResultSet) parameterValue;
            // See if we can find a column in the metadata with the same
            // name as the input
            IPentahoMetaData md = rs.getMetaData();
            int columnIdx = -1;
            if ( md.getColumnCount() == 1 ) {
              columnIdx = 0;
            } else {
              columnIdx = md.getColumnIndex( new String[] { parameter } );
            }
            if ( columnIdx < 0 ) {
              error( Messages.getInstance().getErrorString( "Template.ERROR_0005_COULD_NOT_DETERMINE_COLUMN" ) ); //$NON-NLS-1$
              return -1;
            }
View Full Code Here

          value = valueStr.substring( 1, valueStr.length() - 1 );
        } else if ( valueObj instanceof IPentahoResultSet ) {
          IPentahoResultSet rs = (IPentahoResultSet) valueObj;
          // See if we can find a column in the metadata with the same
          // name as the input
          IPentahoMetaData md = rs.getMetaData();
          int columnIdx = -1;
          if ( md.getColumnCount() == 1 ) {
            columnIdx = 0;
          } else {
            columnIdx = md.getColumnIndex( new String[] { name } );
          }
          if ( columnIdx < 0 ) {
            InputProperties.inputPropertiesLogger.error( Messages.getInstance().getErrorString(
                "Template.ERROR_0005_COULD_NOT_DETERMINE_COLUMN" ) ); //$NON-NLS-1$
            return null;
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

            }
          } else if ( parameterValue instanceof IPentahoResultSet ) {
            IPentahoResultSet rs = (IPentahoResultSet) parameterValue;
            // See if we can find a column in the metadata with the same
            // name as the input
            IPentahoMetaData md = rs.getMetaData();
            int columnIdx = -1;
            if ( md.getColumnCount() == 1 ) {
              columnIdx = 0;
            } else {
              columnIdx = md.getColumnIndex( new String[] { parameter } );
            }
            if ( columnIdx < 0 ) {
              error( Messages.getInstance().getErrorString( "Template.ERROR_0005_COULD_NOT_DETERMINE_COLUMN" ) ); //$NON-NLS-1$
              return -1;
            }
View Full Code Here

              }
            } else if ( parameterValue instanceof IPentahoResultSet ) {
              IPentahoResultSet rs = (IPentahoResultSet) parameterValue;
              // See if we can find a column in the metadata with the same
              // name as the input
              IPentahoMetaData md = rs.getMetaData();
              int columnIdx = -1;
              if ( md.getColumnCount() == 1 ) {
                columnIdx = 0;
              } else {
                columnIdx = md.getColumnIndex( new String[] { parameter } );
              }
              if ( columnIdx < 0 ) {
                error( Messages.getInstance().getErrorString( "Template.ERROR_0005_COULD_NOT_DETERMINE_COLUMN" ) ); //$NON-NLS-1$
                return -1;
              }
View Full Code Here

    return null;
  }

  public IPentahoResultSet memoryCopy() {
    try {
      IPentahoMetaData meta = getMetaData();
      Object[][] columnHeaders = meta.getColumnHeaders();
      MemoryMetaData cachedMetaData = new MemoryMetaData( columnHeaders, null );
      MemoryResultSet cachedResultSet = new MemoryResultSet( cachedMetaData );
      Object[] rowObjects = next();
      while ( rowObjects != null ) {
        cachedResultSet.addRow( rowObjects );
View Full Code Here

TOP

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

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.