Package org.adbcj.support

Examples of org.adbcj.support.DefaultValue


                throw new IllegalStateException("Don't know how to handle field to type " + field.getColumnType());
              }
              if (jdbcResultSet.wasNull()) {
                value = null;
              }
              eventHandler.value(new DefaultValue(field, value), accumulator);
            }
            eventHandler.endRow(accumulator);
          }
          eventHandler.endResults(accumulator);
         
View Full Code Here


            default:
              throw new IllegalStateException("Don't know how to handle column type of "
                  + field.getColumnType());
            }
          }
          values[field.getIndex()] = new DefaultValue(field, value);
          if (i < fields.length) {
            fieldCount = in.read();
          }

        }
View Full Code Here

    for (int i = 0; i < fieldCount; i++) {
      int valueLength = input.readInt();
      PgField field = fields[i];
      Value value;
      if (valueLength < 0) {
        value = new DefaultValue(field, null);
      } else {
        String strVal;
        switch (field.getColumnType()) {
        case INTEGER:
          switch (field.getFormatCode()) {
          case BINARY:
            value = new DefaultValue(field, input.readInt());
            break;
          case TEXT:
            strVal = input.readString(valueLength, charset);
            value = new DefaultValue(field, Integer.valueOf(strVal));
            break;
          default:
            throw new IllegalStateException("Unable to decode format of " + field.getFormatCode());
          }
          break;
        case BIGINT:
          switch (field.getFormatCode()) {
          case BINARY:
            value = new DefaultValue(field, (long)input.readInt() << 32 | input.readInt());
            break;
          case TEXT:
            strVal = input.readString(valueLength, charset);
            value = new DefaultValue(field, Long.valueOf(strVal));
            break;
          default:
            throw new IllegalStateException("Unable to decode format of " + field.getFormatCode());
          }
          break;
        case VARCHAR:
          strVal = input.readString(valueLength, charset);
          value = new DefaultValue(field, strVal);
          break;
        default:
          // Advance buffer
          input.skip(valueLength);
          // TODO Handle remaining ADBCJ types
View Full Code Here

TOP

Related Classes of org.adbcj.support.DefaultValue

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.