Package org.apache.derby.client.am

Examples of org.apache.derby.client.am.ClientMessageId


                    padScalarStreamForError(leftToRead, bytesToRead,
                            writeEXTDTAStatusByte, status);
          // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
          netAgent_.accumulateReadException(new SqlException(
                                     netAgent_.logWriter_,
                                     new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ),
                                     new Integer(parameterIndex),
                                     e.getMessage(),
                                     e));

          return;
        }
        if (bytesRead == -1) {
                    status = DRDAConstants.STREAM_TOO_SHORT;
                    padScalarStreamForError(leftToRead, bytesToRead,
                            writeEXTDTAStatusByte, status);
          // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
          netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,
                                     new ClientMessageId(SQLState.NET_PREMATURE_EOS),
                                     new Integer(parameterIndex)));
          return;
        } else {
          bytesToRead -= bytesRead;
          offset_ += bytesRead;
          leftToRead -= bytesRead;
        }
      } while (bytesToRead > 0);

      bytesToRead = flushScalarStreamSegment(leftToRead, bytesToRead);
    } while (leftToRead > 0);

    // check to make sure that the specified length wasn't too small
    try {
      if (in.read() != -1) {
                status = DRDAConstants.STREAM_TOO_LONG;
        // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
        netAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,
                                   new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL),
                                   new Integer(parameterIndex)));
      }
    } catch (java.io.IOException e) {
            status = DRDAConstants.STREAM_READ_ERROR;
      netAgent_.accumulateReadException(new SqlException(
                                 netAgent_.logWriter_,
                                 new ClientMessageId(
                                           SQLState.NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION),
                                 new Integer(parameterIndex),
                                 e.getMessage(),
                                 e));
    }
View Full Code Here


            if (writeEXTDTAStatusByte) {
                writeEXTDTAStatus(DRDAConstants.STREAM_READ_ERROR);
            }
            final SqlException sqlex =
                new SqlException(netAgent_.logWriter_,
                                 new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ),
                                 new Integer(parameterIndex),
                                 e.getMessage(),
                                 e);

            netAgent_.accumulateReadException(sqlex);
View Full Code Here

        int stringByteLength = offset_ - lengthOffset - 4;
        // reset the buffer and throw an SQLException if the length is too long
        if (stringByteLength > byteLengthLimit) {
            offset_ = lengthOffset;
            throw new SqlException(netAgent_.logWriter_,
                    new ClientMessageId(sqlState), string);
        }
        // pad if we don't reach the byteMinLength limit
        if (stringByteLength < byteMinLength) {
            for (int i = stringByteLength ; i < byteMinLength; i++) {
                bytes_[offset_++] = ccsidManager_.space_;
View Full Code Here

            ensureLength(offset_ + 10);
            org.apache.derby.client.am.DateTime.dateToDateBytes(bytes_, offset_, date);
            offset_ += 10;
        } catch (java.io.UnsupportedEncodingException e) {
            throw new SqlException(netAgent_.logWriter_,
                    new ClientMessageId(SQLState.UNSUPPORTED_ENCODING),
                    "java.sql.Date", "DATE", e);
        }
    }
View Full Code Here

            ensureLength(offset_ + 8);
            org.apache.derby.client.am.DateTime.timeToTimeBytes(bytes_, offset_, time);
            offset_ += 8;
        } catch(UnsupportedEncodingException e) {
            throw new SqlException(netAgent_.logWriter_,
                    new ClientMessageId(SQLState.UNSUPPORTED_ENCODING),
                    "java.sql.Time", "TIME", e);
      }
    }
View Full Code Here

            org.apache.derby.client.am.DateTime.timestampToTimestampBytes
                ( bytes_, offset_, timestamp, supportsTimestampNanoseconds );
            offset_ += length;
        }catch(UnsupportedEncodingException e) {
            throw new SqlException(netAgent_.logWriter_, 
                    new ClientMessageId(SQLState.UNSUPPORTED_ENCODING),
                    "java.sql.Timestamp", "TIMESTAMP", e);
        }
    }
View Full Code Here

        byte[] b;
        try {
            b = s.getBytes(encoding);
        } catch (UnsupportedEncodingException e) {
            throw new SqlException(netAgent_.logWriter_, 
                    new ClientMessageId(SQLState.UNSUPPORTED_ENCODING),
                    "String", "byte", e);
        }
        if (b.length > 0x7FFF) {
            throw new SqlException(netAgent_.logWriter_,
                new ClientMessageId(SQLState.LANG_STRING_TOO_LONG),
                "32767");
        }
        ensureLength(offset_ + b.length + 2);
        writeLDBytesX(b.length, b);
    }
View Full Code Here

        catch (Exception e)
        {
            throw new SqlException
                (
                 netAgent_.logWriter_,
                 new ClientMessageId (SQLState.NET_MARSHALLING_UDT_ERROR),
                 e.getMessage(),
                 e
                 );
        }

        if ( length > DRDAConstants.MAX_DRDA_UDT_SIZE )
        {
            throw new SqlException
                (
                 netAgent_.logWriter_,
                 new ClientMessageId(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE),
                 Integer.toString( DRDAConstants.MAX_DRDA_UDT_SIZE ),
                 val.getClass().getName()
                 );
        }
View Full Code Here

        }

        if (sda == null) {
            netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                new DisconnectException(netAgent_,
                    new ClientMessageId(SQLState.NET_INVALID_FDOCA_ID)));
        }

        // 2. Set Null indicator based on PROTOCOL Type.
        //    Nullable SQL and PROTOCOL types are all odd numbers and the nullable
        //    type is one number higher than the related non-nullable type.
View Full Code Here

        netAgent_.setSvrcod(svrcod);
        NetSqlca netSqlca = parseSQLCARD(null);
        netAgent_.netConnection_.completeSqlca(netSqlca);
        agent_.accumulateChainBreakingReadExceptionAndThrow(new DisconnectException(agent_,
            new ClientMessageId(SQLState.DRDA_CONNECTION_TERMINATED),
            msgutil_.getTextMessage(MessageId.CONN_DRDA_CMDCHKRM),
            new Exception(netSqlca.getSqlErrmc())));
    }
View Full Code Here

TOP

Related Classes of org.apache.derby.client.am.ClientMessageId

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.