Package org.apache.derby.iapi.sql

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


          rMetaData = null;
          gcDuringGetMetaData = execp.getActivationClass().getName();
        }
        if (rMetaData == null)
        {
          ResultDescription resd = preparedStatement.getResultDescription();
          if (resd != null)
          {
            // Internally, the result description has information
            // which is used for insert, update and delete statements
            // Externally, we decided that statements which don't
            // produce result sets such as insert, update and delete
            // should not return ResultSetMetaData.  This is enforced
            // here
            String statementType = resd.getStatementType();
            if (statementType.equals("INSERT") ||
                statementType.equals("UPDATE") ||
                statementType.equals("DELETE"))
              rMetaData = null;
            else
View Full Code Here


      if (targetTableDescriptor.getLockGranularity() == TableDescriptor.TABLE_LOCK_GRANULARITY)
      {
        lockMode = TransactionController.MODE_TABLE;
      }

      ResultDescription resultDescription = null;
      if(isDependentTable)
      {
        //triggers need the result description ,
        //dependent tables  don't have a source from generation time
        //to get the result description
View Full Code Here

      rowChanger.setRowHolder(rowHolder);
    }

    if (firstExecute && activation.getAutoGeneratedKeysResultsetMode())
    {
      ResultDescription rd;
      Properties properties = new Properties();
            autoGeneratedKeysColumnIndexes =
                    activation.getAutoGeneratedKeysColumnIndexes();

      // Get the properties on the old heap
View Full Code Here

        //getMetaData call is made.
        //Second check - if the statement was revalidated since last getMetaData call,
        //then gcDuringGetMetaData wouldn't match with current generated class name

                GeneratedClass currAc = null;
                ResultDescription resd = null;

                synchronized(execp) {
                    // DERBY-3823 Some other thread may be repreparing
                    do {
                        while (!execp.upToDate()) {
                            execp.rePrepare(lcc);
                        }

                        currAc = execp.getActivationClass();
                        resd = execp.getResultDescription();
                    } while (currAc == null);
                }

                if (gcDuringGetMetaData == null ||
                        !gcDuringGetMetaData.equals(currAc.getName())) {
                    rMetaData = null;
                    gcDuringGetMetaData = currAc.getName();
                }

                if (rMetaData == null && resd != null) {
                    // Internally, the result description has information
                    // which is used for insert, update and delete statements
                    // Externally, we decided that statements which don't
                    // produce result sets such as insert, update and delete
                    // should not return ResultSetMetaData.  This is enforced
                    // here
                    String statementType = resd.getStatementType();
                    if (statementType.equals("INSERT") ||
                            statementType.equals("UPDATE") ||
                            statementType.equals("DELETE"))
                        rMetaData = null;
                    else
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

          rMetaData = null;
          gcDuringGetMetaData = execp.getActivationClass().getName();
        }
        if (rMetaData == null)
        {
          ResultDescription resd = preparedStatement.getResultDescription();
          if (resd != null)
          {
            // Internally, the result description has information
            // which is used for insert, update and delete statements
            // Externally, we decided that statements which don't
            // produce result sets such as insert, update and delete
            // should not return ResultSetMetaData.  This is enforced
            // here
            String statementType = resd.getStatementType();
            if (statementType.equals("INSERT") ||
                statementType.equals("UPDATE") ||
                statementType.equals("DELETE"))
              rMetaData = null;
            else
View Full Code Here

    }

    int[] columnIndexes = null;
    if (firstExecute && activation.getAutoGeneratedKeysResultsetMode())
    {
      ResultDescription rd;
      Properties properties = new Properties();
      columnIndexes = activation.getAutoGeneratedKeysColumnIndexes();

      // Get the properties on the old heap
      rowChanger.getHeapConglomerateController().getInternalTablePropertySet(properties);
View Full Code Here

    }

    int[] columnIndexes = null;
    if (firstExecute && activation.getAutoGeneratedKeysResultsetMode())
    {
      ResultDescription rd;
      Properties properties = new Properties();
      columnIndexes = activation.getAutoGeneratedKeysColumnIndexes();

      // Get the properties on the old heap
      rowChanger.getHeapConglomerateController().getInternalTablePropertySet(properties);
View Full Code Here

    }

    int[] columnIndexes = null;
    if (firstExecute && activation.getAutoGeneratedKeysResultsetMode())
    {
      ResultDescription rd;
      Properties properties = new Properties();
      columnIndexes = activation.getAutoGeneratedKeysColumnIndexes();

      // Get the properties on the old heap
      rowChanger.getHeapConglomerateController().getInternalTablePropertySet(properties);
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.