Examples of ClientMessageId


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

        return SSL_BASIC;
      } else if (s.equalsIgnoreCase("peerAuthentication")) {
        return SSL_PEER_AUTHENTICATION;
      } else {
                throw new SqlException(null,
                                       new ClientMessageId(SQLState.INVALID_ATTRIBUTE),
                                       Attribute.SSL_ATTR, s, "off, basic, peerAuthentication");
      }
    } else {
      // Default
      return SSL_OFF;
View Full Code Here

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

                String v = attrTokenizer.nextToken();

                int eqPos = v.indexOf('=');
                if (eqPos == -1) {
                    throw new SqlException(null,
                        new ClientMessageId(SQLState.INVALID_ATTRIBUTE_SYNTAX),
                        attributeString);
                }
               
                augmentedProperties.setProperty((v.substring(0, eqPos)).trim(), (v.substring(eqPos + 1)).trim());
            }
        } catch (NoSuchElementException e) {
            // A null log writer is passed, because jdbc 1 sqlexceptions are automatically traced
            throw new SqlException(null,
                new ClientMessageId(SQLState.INVALID_ATTRIBUTE_SYNTAX),
                attributeString, e);
        }
        checkBoolean(augmentedProperties, Attribute.CLIENT_RETIEVE_MESSAGE_TEXT);
        return augmentedProperties;
View Full Code Here

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

            }
            choicesStr += choices[i];
        }

        throw new SqlException(null,
            new ClientMessageId(SQLState.INVALID_ATTRIBUTE),
            attribute, value, choicesStr);
    }
View Full Code Here

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

        totalBytesRead += bytesRead;
      } catch (java.io.IOException e) {
        padScalarStreamForError(leftToRead, bytesToRead);
        // 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) {
        //padScalarStreamForError(leftToRead, bytesToRead);
        // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.
        /*throw new SqlException(netAgent_.logWriter_,
          "End of Stream prematurely reached while reading InputStream, parameter #" +
          parameterIndex +
          ".  Remaining data has been padded with 0x0.");*/
        //is it OK to do a chain break Exception here. It's not good to
        //pad it with 0 and encrypt and send it to the server because it takes too much time
        //can't just throw a SQLException either because some of the data PRPSQLSTT etc have already
        //been sent to the server, and server is waiting for EXTDTA, server hangs for this.
        netAgent_.accumulateChainBreakingReadExceptionAndThrow(
                                     new DisconnectException(netAgent_,
                                                 new ClientMessageId(SQLState.NET_PREMATURE_EOS_DISCONNECT),
                                                 new Integer(parameterIndex)));
        return;

        /*netAgent_.accumulateReadException(
          new SqlException(netAgent_.logWriter_,
          "End of Stream prematurely reached while reading InputStream, parameter #" +
          parameterIndex +
          ".  Remaining data has been padded with 0x0."));
          return;*/
      } else {
        pos += bytesRead;
        //offset_ += bytesRead;  //comment this out for data stream encryption.
        leftToRead -= bytesRead;
      }

    } while (leftToRead > 0);

    // check to make sure that the specified length wasn't too small
    try {
      if (in.read() != -1) {
        // 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) {
      netAgent_.accumulateReadException(new SqlException(
                                 netAgent_.logWriter_,
                                 new ClientMessageId(
                                           SQLState.NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION),
                                 new Integer(parameterIndex),
                                 e.getMessage(),
                                 e));
    }
View Full Code Here

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

        } catch (java.io.IOException e) {
          padScalarStreamForError(leftToRead, bytesToRead);
          // 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) {
          padScalarStreamForError(leftToRead, bytesToRead);
          // 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) {
        // 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) {
      netAgent_.accumulateReadException(new SqlException(
                                 netAgent_.logWriter_,
                                 new ClientMessageId(
                                           SQLState.NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION),
                                 new Integer(parameterIndex),
                                 e.getMessage(),
                                 e));
    }
View Full Code Here

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

           
        } catch (java.io.IOException e) {
           
            final SqlException sqlex =
                new SqlException(netAgent_.logWriter_,
                                 new ClientMessageId(SQLState.NET_IOEXCEPTION_ON_READ),
                                 new Integer(parameterIndex),
                                 e.getMessage(),
                                 e);

            netAgent_.accumulateReadException(sqlex);
           
          return;
        }
       
       
       
    // check to make sure that the specified length wasn't too small
    try {
      if (in.read() != -1) {
        // set with SQLSTATE 01004: The value of a string was truncated when assigned to a host variable.

                final SqlException sqlex =
                    new SqlException(netAgent_.logWriter_,
                                     new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL),
                                     new Integer(parameterIndex));

        netAgent_.accumulateReadException(sqlex);
      }
    } catch (java.io.IOException e) {
      netAgent_.accumulateReadException(new SqlException(
                                 netAgent_.logWriter_,
                                 new ClientMessageId(
                                           SQLState.NET_IOEXCEPTION_ON_STREAMLEN_VERIFICATION),
                                 new Integer(parameterIndex),
                                 e.getMessage(),
                                 e));
    }
View Full Code Here

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

            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

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

            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

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

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

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

        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
TOP
Copyright © 2018 www.massapi.com. 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.