Package com.impossibl.postgres.protocol

Examples of com.impossibl.postgres.protocol.ResultField


    }

    //Build result set (manually)

    ResultField[] resultFields = new ResultField[21];
    resultFields[0] = new ResultField("TYPE_CAT",           0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[1] = new ResultField("TYPE_SCHEM",         0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[2] = new ResultField("TYPE_NAME",          0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[3] = new ResultField("ATTR_NAME",          0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[4] = new ResultField("DATA_TYPE",          0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[5] = new ResultField("ATTR_TYPE_NAME",     0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[6] = new ResultField("ATTR_SIZE",          0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[7] = new ResultField("DECIMAL_DIGITS",     0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[8] = new ResultField("NUM_PREC_RADIX",     0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[9] = new ResultField("NULLABLE",           0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[10] = new ResultField("REMARKS",           0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[11] = new ResultField("ATTR_DEF",          0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[12] = new ResultField("SQL_DATA_TYPE",     0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[13] = new ResultField("SQL_DATETIME_SUB"0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[14] = new ResultField("CHAR_OCTET_LENGTH", 0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[15] = new ResultField("ORDINAL_POSITION"0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[16] = new ResultField("IS_NULLABLE",       0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[17] = new ResultField("SCOPE_CATLOG",      0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[18] = new ResultField("SCOPE_SCHEMA",      0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[19] = new ResultField("SCOPE_TABLE",       0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[20] = new ResultField("SOURCE_DATA_TYPE"0, (short)0, registry.loadType("int2"),   (short)0, 0, Format.Binary);

    List<Object[]> results = new ArrayList<>();

    for (int c = 0; c < attrsData.size(); ++c) {
View Full Code Here


    Registry registry = connection.getRegistry();

    ResultField[] resultFields = new ResultField[18];
    List<Object[]> results = new ArrayList<>();

    resultFields[0] =   new ResultField("NAME",               0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[1] =   new ResultField("MAX_LEN",            0, (short)0, registry.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[2] =   new ResultField("DEFAULT_VALUE",      0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[3] =   new ResultField("DESCRIPTION",        0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);

    Object[] row = new Object[4];

    //ApplicationName
    row[0] = "ApplicationName";
View Full Code Here

    }

    //Build result set (manually)

    ResultField[] resultFields = new ResultField[24];
    resultFields[0] = new ResultField("TABLE_CAT",          0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[1] = new ResultField("TABLE_SCHEM",        0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[2] = new ResultField("TABLE_NAME",         0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[3] = new ResultField("COLUMN_NAME",        0, (short)0, registry.loadType("text"),   (short)0, 0, Format.Binary);
    resultFields[4] = new ResultField("DATA_TYPE",          0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[5] = new ResultField("COLUMN_SIZE",        0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[6] = new ResultField("DECIMAL_DIGITS",     0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[7] = new ResultField("NUM_PREC_RADIX",     0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[8] = new ResultField("COLUMN_USAGE",      0, (short)0, registry.loadType("int4"),   (short)0, 0, Format.Binary);
    resultFields[9] = new ResultField("REMARKS", 0, (short) 0, registry.loadType("text"), (short) 0, 0, Format.Binary);
    resultFields[10] = new ResultField("CHAR_OCTET_LENGTH", 0, (short) 0, registry.loadType("int4"), (short) 0, 0, Format.Binary);
    resultFields[11] = new ResultField("IS_NULLABLE", 0, (short) 0, registry.loadType("text"), (short) 0, 0, Format.Binary);

    List<Object[]> results = new ArrayList<>();

    for (int c = 0; c < columnsData.size(); ++c) {
View Full Code Here

          Object[] returnValues = (Object[]) returnValuesBatch.results.get(0);

          for (int c = 0; c < outParameterValues.size(); ++c) {

            ResultField field = returnValuesBatch.fields.get(c);

            outParameterNames.set(c, field.name);
            outParameterTypes.set(c, field.typeRef.get());
            outParameterValues.set(c, returnValues[c]);
          }
View Full Code Here

        Object rowInstance = createInstance(rowType, itemCount);

        for (int c = 0; c < itemCount; ++c) {

          ResultField field = resultBatch.fields.get(c);

          Type fieldType = field.typeRef.get();

          Type.Codec.Decoder decoder = fieldType.getCodec(field.format).decoder;
View Full Code Here

      Object[] rowInstance = new Object[fieldCount];

      for (int c = 0; c < fieldCount; ++c) {

        ResultField field = resultBatch.fields.get(c);

        Type fieldType = field.typeRef.get();

        Type.Codec.Decoder decoder = fieldType.getCodec(field.format).decoder;
View Full Code Here

    Registry reg = connection.getRegistry();

    Type elementType = getDimensions(value) > 1 ? type : type.getElementType();

    ResultField[] fields = {
      new ResultField("INDEX", 0, (short)0, reg.loadType("int4"), (short)0, 0, Format.Binary),
      new ResultField("VALUE", 0, (short)0, elementType, (short)0, 0, Format.Binary)
    };

    List<Object[]> results = new ArrayList<Object[]>(value.length);
    for (long c = index, end = index + count; c < end; ++c) {
      results.add(new Object[]{c, value[(int) c - 1]});
View Full Code Here

    ResultField[] fields = new ResultField[fieldCount];

    for (int c = 0; c < fieldCount; ++c) {

      ResultField field = new ResultField();
      field.name = readCString(buffer, context.getCharset());
      field.relationId = buffer.readInt();
      field.relationAttributeNumber = buffer.readShort();
      field.typeRef = TypeRef.from(buffer.readInt(), registry);
      field.typeLength = buffer.readShort();
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.protocol.ResultField

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.