Package org.apache.derby.iapi.sql.execute

Examples of org.apache.derby.iapi.sql.execute.CursorActivation


            setupContextStack();
            //now construct the delete where current of sql
            try {
                StringBuffer deleteWhereCurrentOfSQL = new StringBuffer("DELETE FROM ");
                CursorActivation activation = getEmbedConnection().getLanguageConnection().lookupCursorActivation(getCursorName());
                deleteWhereCurrentOfSQL.append(getFullBaseTableName(activation.getPreparedStatement().getTargetTable()));//get the underlying (schema.)table name
                //using quotes around the cursor name to preserve case sensitivity
                deleteWhereCurrentOfSQL.append(" WHERE CURRENT OF \"" + getCursorName() + "\"");

                LanguageConnectionContext lcc = getEmbedConnection().getLanguageConnection();
                StatementContext statementContext = lcc.pushStatementContext(isAtomic, deleteWhereCurrentOfSQL.toString(), null, false);
View Full Code Here


    if (cursor == null) {

      LanguageConnectionContext lcc = getLanguageConnectionContext();

      CursorActivation cursorActivation = lcc.lookupCursorActivation(cursorName);

      if (cursorActivation != null)
      {
        // check we are compiled against the correct cursor
        PreparedStatement cps = cursorActivation.getPreparedStatement();

        if (psName.equals(cps.getObjectName())) {
          cursor = cursorActivation.getCursorResultSet();
          target = cursorActivation.getTargetResultSet();
          /* beetle 3865: updateable cursor using index. 2 way communication between
           * update activation and cursor activation. Cursor passes index scan to
           * update and update passes heap conglom controller to cursor.
           */
          activation.setForUpdateIndexScan(cursorActivation.getForUpdateIndexScan());
          if (cursorActivation.getHeapConglomerateController() != null)
            cursorActivation.getHeapConglomerateController().close();
          cursorActivation.setHeapConglomerateController(activation.getHeapConglomerateController());
        } else {

          // our prepared statement is now invalid since there
          // exists another cursor with the same name but a different
          // statement.
View Full Code Here

                return; //nothing to do since no updates were made to this row

            //now construct the update where current of sql
            boolean foundOneColumnAlready = false;
            StringBuffer updateWhereCurrentOfSQL = new StringBuffer("UPDATE ");
            CursorActivation activation = getEmbedConnection().getLanguageConnection().lookupCursorActivation(getCursorName());


            ExecCursorTableReference targetTable = activation.getPreparedStatement().getTargetTable();
            updateWhereCurrentOfSQL.append(getFullBaseTableName(targetTable));//got the underlying (schema.)table name
            updateWhereCurrentOfSQL.append(" SET ");
            ResultDescription rd = theResults.getResultDescription();

            for (int i=1; i<=rd.getColumnCount(); i++) { //in this for loop we are constructing columnname=?,... part of the update sql
View Full Code Here

            setupContextStack();
            //now construct the delete where current of sql
            try {
                StringBuffer deleteWhereCurrentOfSQL = new StringBuffer("DELETE FROM ");
                CursorActivation activation = getEmbedConnection().getLanguageConnection().lookupCursorActivation(getCursorName());
                deleteWhereCurrentOfSQL.append(getFullBaseTableName(activation.getPreparedStatement().getTargetTable()));//get the underlying (schema.)table name
                //using quotes around the cursor name to preserve case sensitivity
                deleteWhereCurrentOfSQL.append(" WHERE CURRENT OF \"" + getCursorName() + "\"");

                LanguageConnectionContext lcc = getEmbedConnection().getLanguageConnection();
                StatementContext statementContext = lcc.pushStatementContext(isAtomic, deleteWhereCurrentOfSQL.toString(), null, false);
View Full Code Here

                 */

                boolean foundOneColumnAlready = false;
                StringBuffer insertSQL = new StringBuffer("INSERT INTO ");
                StringBuffer valuesSQL = new StringBuffer("VALUES (");
                CursorActivation activation = lcc.lookupCursorActivation(getCursorName());

                ExecCursorTableReference targetTable =
                        activation.getPreparedStatement().getTargetTable();
                // got the underlying (schema.)table name
                insertSQL.append(getFullBaseTableName(targetTable));

                insertSQL.append(" (");
                // in this for loop we are constructing list of column-names
View Full Code Here

                return; //nothing to do since no updates were made to this row

            //now construct the update where current of sql
            boolean foundOneColumnAlready = false;
            StringBuffer updateWhereCurrentOfSQL = new StringBuffer("UPDATE ");
            CursorActivation activation = lcc.lookupCursorActivation(getCursorName());


            ExecCursorTableReference targetTable = activation.getPreparedStatement().getTargetTable();
            updateWhereCurrentOfSQL.append(getFullBaseTableName(targetTable));//got the underlying (schema.)table name
            updateWhereCurrentOfSQL.append(" SET ");
     
            for (int i=1; i<=resultDescription.getColumnCount(); i++) { //in this for loop we are constructing columnname=?,... part of the update sql
                if (columnGotUpdated[i-1]) { //if the column got updated, do following
View Full Code Here

            StatementContext statementContext = null;
           
            //now construct the delete where current of sql
            try {
                StringBuffer deleteWhereCurrentOfSQL = new StringBuffer("DELETE FROM ");
                CursorActivation activation = lcc.lookupCursorActivation(getCursorName());
                deleteWhereCurrentOfSQL.append(getFullBaseTableName(activation.getPreparedStatement().getTargetTable()));//get the underlying (schema.)table name
                //using quotes around the cursor name to preserve case sensitivity
                deleteWhereCurrentOfSQL.append(" WHERE CURRENT OF " +
                        IdUtil.normalToDelimited(getCursorName()));
               
                // Context used for preparing, don't set any timeout (use 0)
View Full Code Here

    if (ps == null)
      return;
     
    LanguageConnectionContext lcc = getLanguageConnectionContext();

    CursorActivation cursorActivation = lcc.lookupCursorActivation(cursorName);

    if (cursorActivation != null)
    {
      // check we are compiled against the correct cursor
      if (!psName.equals(cursorActivation.getPreparedStatement().getObjectName())) {

        // our prepared statement is now invalid since there
        // exists another cursor with the same name but a different
        // statement.
        ps.makeInvalid(DependencyManager.CHANGED_CURSOR, lcc);
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.execute.CursorActivation

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.