Package org.apache.derby.iapi.error

Examples of org.apache.derby.iapi.error.StandardException


    private static final char[] END_OF_STRING = {(char) 0};
   
    private void parseTimestamp( String timestampStr, boolean isJDBCEscape, LocaleFinder localeFinder, Calendar cal)
        throws StandardException
    {
        StandardException thrownSE = null;
        DateTimeParser parser = new DateTimeParser( timestampStr);
        try
        {
            int[] dateTimeNano = parseDateOrTimestamp( parser, true);
            encodedDate = dateTimeNano[0];
View Full Code Here


        ConstraintDescriptor conDesc = dd.getConstraintDescriptor(td,
                                                                      cd.getUUID());
        indexOrConstraintName = conDesc.getConstraintName();
      }   

      StandardException se =
        StandardException.newException(
        SQLState.LANG_DUPLICATE_KEY_CONSTRAINT, indexOrConstraintName, tableName);
      throw se;
    }
    if (SanityManager.DEBUG)
View Full Code Here

                      firstFailedRow);
 
        int numFailures = riChecker.doCheck();
        if (numFailures > 0)
        {
          StandardException se = StandardException.newException(SQLState.LANG_FK_VIOLATION, fkConstraintName,
                  fkInfo.tableName,
                  StatementUtil.typeName(fkInfo.stmtType),
                  RowUtil.toString(firstFailedRow, 0, fkInfo.colArray.length - 1));
          throw se;
        }
View Full Code Here

        {
            // Need to ensure all the result sets opened by this
            // CALL statement for this connection are closed.
            // If any close() results in an exception we need to keep going,
            // save any exceptions and then throw them once we are complete.
            StandardException errorOnClose = null;
           
            ConnectionContext jdbcContext = null;
           
            for (int i = 0; i < dynamicResults.length; i++)
            {
                ResultSet[] param = dynamicResults[i];
                ResultSet drs = param[0];
               
                // Can be null if the procedure never set this parameter
                // or if the dynamic results were processed by JDBC (EmbedStatement).
                if (drs == null)
                    continue;
               
                if (jdbcContext == null)
                    jdbcContext = (ConnectionContext)
                   lcc.getContextManager().getContext(ConnectionContext.CONTEXT_ID);
              
                try {
                   
                    // Is this a valid, open dynamic result set for this connection?
                    if (!jdbcContext.processInaccessibleDynamicResult(drs))
                    {
                        // If not just ignore it, not Derby's problem.
                        continue;
                    }
                   
                    drs.close();
                   
                } catch (SQLException e) {
                   
                    // Just report the first error
                    if (errorOnClose == null)
                    {
                        StandardException se = StandardException.plainWrapException(e);
                        errorOnClose = se;
                    }
                }
                finally {
                    // Remove any reference to the ResultSet to allow
View Full Code Here

               */
              secondRow = source.getNextRowCore();
              if (secondRow != null)
              {
                close();
                StandardException se = StandardException.newException(SQLState.LANG_SCALAR_SUBQUERY_CARDINALITY_VIOLATION);
                throw se;
              }
            }
            result = candidateRow;
            break;

          case UNIQUE_CARDINALITY_CHECK:
            candidateRow = candidateRow.getClone();
            secondRow = source.getNextRowCore();
            DataValueDescriptor orderable1 = candidateRow.getColumn(1);
            while (secondRow != null)
            {
              DataValueDescriptor orderable2 = secondRow.getColumn(1);
              if (! (orderable1.compare(DataValueDescriptor.ORDER_OP_EQUALS, orderable2, true, true)))
              {
                close();
                StandardException se = StandardException.newException(SQLState.LANG_SCALAR_SUBQUERY_CARDINALITY_VIOLATION);
                throw se;
              }
              secondRow = source.getNextRowCore();
            }
            result = candidateRow;
View Full Code Here

        }


        Thread.interrupted();

        StandardException e =
            StandardException.newException(SQLState.CONN_INTERRUPT);

        if (lcc != null) {
            lcc.setInterruptedException(e);
View Full Code Here

     * Use when lcc is dying to save info in thread local instead. Useful under
     * shutdown.
     */
    public static void saveInfoFromLcc(LanguageConnectionContext lcc) {
       
        StandardException e = lcc.getInterruptedException();

        if (e != null) {
            exception.set(e);
        }
    }
View Full Code Here

        if (Thread.currentThread().isInterrupted()) {
            setInterrupted();
        }

        StandardException e = lcc.getInterruptedException();

        if (e != null) {
            lcc.setInterruptedException(null);
            // Set thread's interrupt status flag back on.
            Thread.currentThread().interrupt();
View Full Code Here

   * @exception StandardException Thrown on error
   */
  public void cleanupOnError(Throwable error) throws StandardException {
    if (error instanceof StandardException) {

      StandardException se = (StandardException) error;
            int severity = se.getSeverity();
            if (severity >= ExceptionSeverity.SESSION_SEVERITY)
            {
               popMe();
               return;
            }
View Full Code Here

                                throw Timeout.buildException(
                                    waitingLock, timeoutLockTable, currentTime);
                            }
                            else
                            {
                                StandardException se =
                                    StandardException.newException(
                                        SQLState.LOCK_TIMEOUT);

                                throw se;
                            }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.error.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.