Package org.apache.derby.iapi.sql

Examples of org.apache.derby.iapi.sql.ResultDescription


   

    if (columnName == null)
      throw newSQLException(SQLState.NULL_COLUMN_NAME);

    ResultDescription rd = resultDescription;

      // 1 or 0 based? assume 1 (probably wrong)
        // Changing the order in which columns are found from 1 till column count.
        // This is necessary in cases where the column names are the same but are in different cases.
        // This is because in updateXXX and getXXX methods column names are case insensitive
        // and in that case the first column should be returned.
       
        int columnCount = rd.getColumnCount();

        for(int i = 1 ; i<= columnCount;i++) {
        String name = rd.getColumnDescriptor(i).getName();
        if (StringUtil.SQLEqualsIgnoreCase(columnName, name)) {
          return i;
        }
      }
      throw newSQLException(SQLState.COLUMN_NOT_FOUND, columnName);
View Full Code Here


    hasBeforeRowTrigger = (triggerInfo != null) ?
        triggerInfo.hasTrigger(true, true) :
        false;

        ResultDescription resultDescription = activation.getResultDescription();

    // Is this a bulkInsert or regular insert?
    String insertMode = constants.getProperty("insertMode");

                RowLocation[] rla;

    if ((rla = constants.getAutoincRowLocation()) != null)
    {
      aiCache =
        new NumberDataValue[rla.length];
      for (int i = 0; i < resultDescription.getColumnCount(); i++)
      {
        if (rla[i] == null)
          continue;
        ResultColumnDescriptor rcd =
          resultDescription.getColumnDescriptor(i + 1);
        aiCache[i] = (NumberDataValue)rcd.getType().getNull();
      }
    }

    if (insertMode != null)
View Full Code Here

    triggerInfo = constants.getTriggerInfo();

    heapConglom = constants.conglomId;

    baseRowReadList = constants.getBaseRowReadList();
        ResultDescription resultDescription;
    if(passedInRsd ==null)
      resultDescription = activation.getResultDescription();
    else
      resultDescription = passedInRsd;
    /*
    ** We NEED a result description when we are going to
    ** to have to kick off a trigger.  In a replicated environment
    ** we don't get a result description when we are replaying
    ** source xacts on the target, which should never be the
    ** case for an UpdateResultSet.
    */
    if (SanityManager.DEBUG)
    {
      if (resultDescription == null)
      {
        SanityManager.ASSERT(triggerInfo == null, "triggers need a result description to pass to result sets given to users");
      }
    }

    if (fkInfoArray != null)
    {
      for (int i = 0; i < fkInfoArray.length; i++)
      {
        if (fkInfoArray[i].type == FKInfo.REFERENCED_KEY)
        {
          updatingReferencedKey = true;
          if (SanityManager.DEBUG)
          {
            SanityManager.ASSERT(constants.deferred, "updating referenced key but update not deferred, wuzzup?");
          }
        }
        else
       
          updatingForeignKey = true;
        }
      }
    }

    /* Get the # of columns in the ResultSet */
    resultWidth = resultDescription.getColumnCount();
   
    /*
    ** Calculate the # of columns in the base table.  The result set
    ** contains the before columns, the after columns, and the RowLocation,
    ** so the number of base columns is half of the number of result set
View Full Code Here

                // are performed in the driving ResultSet.
                //
                if ( firstColumn < 0 ) { firstColumn = NormalizeResultSet.computeStartColumn( isUpdate, activation.getResultDescription() ); }
                if ( generatedColumnPositions == null ) { setupGeneratedColumns( activation, (ValueRow) newRow ); }
               
                ResultDescription   resultDescription = activation.getResultDescription();
                int                         count = generatedColumnPositions.length;

                for ( int i = 0; i < count; i++ )
                {
                    int         position = generatedColumnPositions[ i ];

                    DataValueDescriptor normalizedColumn = NormalizeResultSet.normalizeColumn
                        (
                         resultDescription.getColumnDescriptor( position ).getType(),
                         newRow,
                         position,
                         normalizedGeneratedValues[ i ],
                         resultDescription
                         );
View Full Code Here

    * which columns in the target row have generation clauses which need to be run.
    */
    private void    setupGeneratedColumns( Activation activation, ValueRow newRow )
        throws StandardException
    {
        ResultDescription   resultDescription = activation.getResultDescription();
        int                         columnCount = resultDescription.getColumnCount();
        ExecRow                 emptyRow = newRow.getNewNullRow();
        int                         generatedColumnCount = 0;

        // first count the number of generated columns
        for ( int i = 1; i <= columnCount; i++ )
        {
            if ( i < firstColumn ) { continue; }
           
            ResultColumnDescriptor  rcd = resultDescription.getColumnDescriptor( i );

            if ( rcd.hasGenerationClause() ) { generatedColumnCount++; }
        }

        // now allocate and populate support structures
        generatedColumnPositions = new int[ generatedColumnCount ];
        normalizedGeneratedValues = new DataValueDescriptor[ generatedColumnCount ];

        int     idx = 0;
        for ( int i = 1; i <= columnCount; i++ )
        {
            if ( i < firstColumn ) { continue; }
           
            ResultColumnDescriptor  rcd = resultDescription.getColumnDescriptor( i );

            if ( rcd.hasGenerationClause() )
            {
                generatedColumnPositions[ idx ] = i;
                normalizedGeneratedValues[ idx ] = emptyRow.getColumn( i );
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.ResultDescription

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.