Package com.akiban.sql

Examples of com.akiban.sql.StandardException


    */
    private void checkRequiredRoutineClause(Object[] clauses)
            throws StandardException {
        String language = (String)clauses[CreateAliasNode.LANGUAGE];
        if (language == null) {
            throw new StandardException("Missing required " + ROUTINE_CLAUSE_NAMES[CreateAliasNode.LANGUAGE]);
        }
        int[] required;
        if (language.equalsIgnoreCase("JAVA")) {
            required = new int[] {
                CreateAliasNode.PARAMETER_STYLE,
                CreateAliasNode.EXTERNAL_NAME
            };
        }
        else {
            required = new int[] {
                CreateAliasNode.PARAMETER_STYLE,
                CreateAliasNode.INLINE_DEFINITION
            };
        }
        for (int i = 0; i < required.length; i++) {
            int re = required[i];
            if (clauses[re] == null) {
                throw new StandardException("Missing required " + ROUTINE_CLAUSE_NAMES[re]);
            }
        }
    }
View Full Code Here


    case CALL:
      jj_consume_token(CALL);
      value = primaryExpression();
        if (! (value instanceof JavaToSQLValueNode) ||
            ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode)) {
            {if (true) throw new StandardException("Invalid call statement");}
        }

        StatementNode callStatement = (StatementNode)
            nodeFactory.getNode(NodeTypes.CALL_STATEMENT_NODE,
                                value,
                                parserContext);

        {if (true) return callStatement;}
      break;
    case QUESTION_MARK:
    case DOLLAR_N:
      // ? = CALL method()
          returnParam = dynamicParameterSpecification();
      jj_consume_token(EQUALS_OPERATOR);
      jj_consume_token(CALL);
      resultSetNode = rowValueConstructor(null);
        // Validate that we have something that is an appropriate call statement.
        ResultColumnList rcl = resultSetNode.getResultColumns();

        // We can have only 1 return value/column.
        if (rcl == null || rcl.size() > 1) {
            {if (true) throw new StandardException("Invalid call statement");}
        }

        // We must have a method call node.
        value = rcl.get(0).getExpression();
        if (! (value instanceof JavaToSQLValueNode) ||
            ! (((JavaToSQLValueNode) value).getJavaValueNode() instanceof MethodCallNode)) {
            {if (true) throw new StandardException("Invalid call statement");}
        }

        // wrap the row result set in a cursor node
        StatementNode cursorNode = (StatementNode)
            nodeFactory.getNode(NodeTypes.CURSOR_NODE,
View Full Code Here

          break label_3;
        }
      }
        //ON ROLLBACK RETAIN CURSORS is only supported case *** TODO: fix this ***
        if (savepointStatementClauses[SAVEPOINT_RETAIN_CURSORS] == null)
            {if (true) throw new StandardException("Missing required ON ROLLBACK RETAIN CURSORS");}
        savepointStatementType = SavepointNode.StatementType.SET;
      break;
    case ROLLBACK:
      jj_consume_token(ROLLBACK);
      switch (jj_nt.kind) {
View Full Code Here

      throw new ParseException();
    }
        // Check for repeated clause
        if (savepointStatementClauses[clausePosition] != null) {
            String which = SAVEPOINT_CLAUSE_NAMES[clausePosition];
            {if (true) throw new StandardException("Repeated " + which + " clause");}
        }

        savepointStatementClauses[clausePosition] = Boolean.TRUE;
  }
View Full Code Here

        break label_4;
      }
    }
        // NOT LOGGED is mandatory
        if (declareTableClauses[TEMPORARY_TABLE_NOT_LOGGED] == null)
            {if (true) throw new StandardException("Missing required NOT LOGGED");}
        // if ON COMMIT behavior not explicitly specified in DECLARE command, resort to default ON COMMIT DELETE ROWS
        if (declareTableClauses[TEMPORARY_TABLE_ON_COMMIT] == null)
            declareTableClauses[TEMPORARY_TABLE_ON_COMMIT] = Boolean.TRUE;
        // if ON ROLLBACK behavior not explicitly specified in DECLARE command, resort to default ON ROLLBACK DELETE ROWS
        if (declareTableClauses[TEMPORARY_TABLE_ON_ROLLBACK] == null)
View Full Code Here

      }
    }
        // Check for repeated clause.
        if (declareTableClauses[clausePosition] != null) {
            String which = TEMPORARY_TABLE_CLAUSE_NAMES[clausePosition];
            {if (true) throw new StandardException("Repeated " + which + " clause");}
        }
        declareTableClauses[clausePosition] = clauseValue;
  }
View Full Code Here

        jj_la1[70] = jj_gen;
        ;
      }
        if ((precision <= 0) ||
                (precision > MAX_DECIMAL_PRECISION_SCALE)) {
            {if (true) throw new StandardException("Invalid precision: " + precision);}
        }
        else if ((scale < 0) ||
                         (scale > MAX_DECIMAL_PRECISION_SCALE)) {
            {if (true) throw new StandardException("Invalid scale: " + scale);}
        }
        else if (scale > precision) {
            {if (true) throw new StandardException("Scale is greater than precision: " +
                                                                     scale + " > " + precision);}
        }
        /*
        ** If we have a decimal point, need to count it
        ** towards maxwidth.    Max width needs to account
View Full Code Here

            prec = TypeId.DOUBLE_PRECISION;
            scale = TypeId.DOUBLE_SCALE;
            width = TypeId.DOUBLE_MAXWIDTH;
        }
        else
            {if (true) throw new StandardException("Invalid floating point precision: " + prec);}

        /*
            REMIND: this is a slight hack, in that an exact reading of
            the InformationSchema requires that the type the user typed
            in be visible to them in the InformationSchema views. But
View Full Code Here

*
*/
  final public void xmlDocOrContent() throws ParseException, StandardException {
    if ((getToken(1).kind != DOCUMENT) && (getToken(1).kind != CONTENT)) {
        // TODO: Is this needed?
        {if (true) throw new StandardException("Not DOCUMENT or CONTENT");}
    } else if (getToken(1).kind == CONTENT) {
      jj_consume_token(CONTENT);
        // TODO: Fix this by returning a proper value.
        {if (true) throw new StandardException("CONTENT not supported yet");}
    } else if (getToken(1).kind == DOCUMENT) {
      jj_consume_token(DOCUMENT);
        {if (true) return;}
    } else {
      jj_consume_token(-1);
View Full Code Here

                {if (true) return (int)specifiedLength;}
            }
        }
        catch (NumberFormatException nfe) {
        }
        {if (true) throw new StandardException("Invalid LOB length:" + s);}
    throw new Error("Missing return statement in function");
  }
View Full Code Here

TOP

Related Classes of com.akiban.sql.StandardException

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.