Package org.apache.derby.iapi.services.io

Examples of org.apache.derby.iapi.services.io.DerbyIOException


            c = reader.read();

            if (c < 0) {
                break;
            } else if (c != SPACE) {
                throw new DerbyIOException(
                    MessageService.getTextMessage(
                        SQLState.LANG_STRING_TRUNCATION,
                        typeName,
                        "<stream-value>", // Don't show the whole value.
                        String.valueOf(Math.abs(valueLength))),
View Full Code Here


        assertEquals("org.apache.derby.iapi.error.StandardException",
                     cause.getClass().getName());
        cause = cause.getCause();
        assertTrue("Exception not a DerbyIOException",
                   cause instanceof DerbyIOException);
        DerbyIOException dioe = (DerbyIOException)cause;
        assertEquals("Incorrect internal SQL state", expectedInternal,
                     dioe.getSQLState());
    }
View Full Code Here

           
            while(bytesRead < len) {
                numOfBytes = is.read(buffer);
               
                if (numOfBytes == -1) {
                    throw new DerbyIOException(
                        MessageService.getTextMessage(
                                SQLState.SET_STREAM_INEXACT_LENGTH_DATA),
                            SQLState.SET_STREAM_INEXACT_LENGTH_DATA);
                }
               
View Full Code Here

        assertTrue("Exception not an EmbedSQLException",
                   cause instanceof EmbedSQLException);
        cause = cause.getCause();
        assertTrue("Exception not a DerbyIOException",
                   cause instanceof DerbyIOException);
        DerbyIOException dioe = (DerbyIOException)cause;
        assertEquals("Incorrect internal SQL state", expectedInternal,
                     dioe.getSQLState());
    }
View Full Code Here

           
            while(bytesRead < len) {
                numOfBytes = is.read(buffer);
               
                if (numOfBytes == -1) {
                    throw new DerbyIOException(
                        MessageService.getTextMessage(
                                SQLState.SET_STREAM_INEXACT_LENGTH_DATA),
                            SQLState.SET_STREAM_INEXACT_LENGTH_DATA);
                }
               
View Full Code Here

        assertTrue("Exception not an EmbedSQLException",
                   cause instanceof EmbedSQLException);
        cause = cause.getCause();
        assertTrue("Exception not a DerbyIOException",
                   cause instanceof DerbyIOException);
        DerbyIOException dioe = (DerbyIOException)cause;
        assertEquals("Incorrect internal SQL state", expectedInternal,
                     dioe.getSQLState());
    }
View Full Code Here

                        MessageService.getTextMessage(
                            MessageId.STREAM_DRDA_CLIENTSIDE_EXTDTA_READ_ERROR)
                         );
            case DRDAConstants.STREAM_TOO_SHORT:
            case DRDAConstants.STREAM_TOO_LONG:
                throw new DerbyIOException(
                        MessageService.getTextMessage(
                            SQLState.SET_STREAM_INEXACT_LENGTH_DATA),
                        SQLState.SET_STREAM_INEXACT_LENGTH_DATA);
            case DRDAConstants.STREAM_OK:
                // Safe-guard, this method should not be invoked when the
View Full Code Here

        return;

    int remainingBytes = clearLimit();

        if (length > -1 && remainingBytes > 0) {
            throw new DerbyIOException(
                        MessageService.getTextMessage(
                                    SQLState.SET_STREAM_INEXACT_LENGTH_DATA),
                        SQLState.SET_STREAM_INEXACT_LENGTH_DATA);
        }

    // if we had a limit try reading one more byte.
    // JDBC 3.0 states the stream muct have the correct number of characters in it.
    if (remainingBytes == 0) {
      int c;
      try
      {
        c = super.read();
      }
      catch (IOException ioe) {
        c = -1;
      }
      if (c != -1) {
                if (length > -1) {
                    // Stream is not capped, and should have matched the
                    // specified length.
                    throw new DerbyIOException(
                                MessageService.getTextMessage(
                                    SQLState.SET_STREAM_INEXACT_LENGTH_DATA),
                                SQLState.SET_STREAM_INEXACT_LENGTH_DATA);
                } else {
                    // Stream is capped, and has exceeded the maximum length.
                    throw new DerbyIOException(
                            MessageService.getTextMessage(
                                    SQLState.LANG_STRING_TRUNCATION,
                                    typeName,
                                    "XXXX",
                                    String.valueOf(maximumLength)),
View Full Code Here

           
            while(bytesRead < len) {
                numOfBytes = is.read(buffer);
               
                if (numOfBytes == -1) {
                    throw new DerbyIOException(
                        MessageService.getTextMessage(
                                SQLState.SET_STREAM_INEXACT_LENGTH_DATA),
                            SQLState.SET_STREAM_INEXACT_LENGTH_DATA);
                }
               
View Full Code Here

        assertTrue("Exception not an EmbedSQLException",
                   cause instanceof EmbedSQLException);
        cause = cause.getCause();
        assertTrue("Exception not a DerbyIOException",
                   cause instanceof DerbyIOException);
        DerbyIOException dioe = (DerbyIOException)cause;
        assertEquals("Incorrect internal SQL state", expectedInternal,
                     dioe.getSQLState());
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.services.io.DerbyIOException

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.