Examples of ResultField


Examples of com.impossibl.postgres.protocol.ResultField

    }

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

    resultFields[0] = new ResultField("SCOPE",          0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[1] = new ResultField("COLUMN_NAME",    0, (short)0, reg.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[2] = new ResultField("DATA_TYPE",      0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[3] = new ResultField("TYPE_NAME",      0, (short)0, reg.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[4] = new ResultField("COLUMN_SIZE",    0, (short)0, reg.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[5] = new ResultField("BUFFER_LENGTH"0, (short)0, reg.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[6] = new ResultField("DECIMAL_DIGITS", 0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[7] = new ResultField("PSEUDO_COLUMN"0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);

    try (ResultSet rs = execForResultSet(sql.toString(), params)) {
      while (rs.next()) {

        Object[] row = new Object[8];
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

    Registry reg = connection.getRegistry();

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

    resultFields[0] = new ResultField("SCOPE",          0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[1] = new ResultField("COLUMN_NAME",    0, (short)0, reg.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[2] = new ResultField("DATA_TYPE",      0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[3] = new ResultField("TYPE_NAME",      0, (short)0, reg.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[4] = new ResultField("COLUMN_SIZE",    0, (short)0, reg.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[5] = new ResultField("BUFFER_LENGTH"0, (short)0, reg.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[6] = new ResultField("DECIMAL_DIGITS", 0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[7] = new ResultField("PSEUDO_COLUMN"0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);

    Object[] row = new Object[8];

    /* Postgresql does not have any column types that are
     * automatically updated like some databases' timestamp type.
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

    Registry registry = connection.getRegistry();

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

    resultFields[0] =   new ResultField("TYPE_NAME",          0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[1] =   new ResultField("DATA_TYPE",          0, (short)0, registry.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[2] =   new ResultField("PRECISION",          0, (short)0, registry.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[3] =   new ResultField("LITERAL_PREFIX",     0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[4] =   new ResultField("LITERAL_SUFFIX",     0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[5] =   new ResultField("CREATE_PARAMS",      0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[6] =   new ResultField("NULLABLE",           0, (short)0, registry.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[7] =   new ResultField("CASE_SENSITIVE",     0, (short)0, registry.loadType("bool"), (short)0, 0, Format.Binary);
    resultFields[8] =   new ResultField("SEARCHABLE",         0, (short)0, registry.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[9] =   new ResultField("UNSIGNED_ATTRIBUTE", 0, (short)0, registry.loadType("bool"), (short)0, 0, Format.Binary);
    resultFields[10] new ResultField("FIXED_PREC_SCALE",   0, (short)0, registry.loadType("bool"), (short)0, 0, Format.Binary);
    resultFields[11] new ResultField("AUTO_INCREMENT",     0, (short)0, registry.loadType("bool"), (short)0, 0, Format.Binary);
    resultFields[12] new ResultField("LOCAL_TYPE_NAME",    0, (short)0, registry.loadType("text"), (short)0, 0, Format.Binary);
    resultFields[13] new ResultField("MINIMUM_SCALE",      0, (short)0, registry.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[14] new ResultField("MAXIMUM_SCALE",      0, (short)0, registry.loadType("int2"), (short)0, 0, Format.Binary);
    resultFields[15] new ResultField("SQL_DATA_TYPE",      0, (short)0, registry.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[16] new ResultField("SQL_DATETIME_SUB",   0, (short)0, registry.loadType("int4"), (short)0, 0, Format.Binary);
    resultFields[17] new ResultField("NUM_PREC_RADIX",     0, (short)0, registry.loadType("int4"), (short)0, 0, Format.Binary);

    String sql =
        "SELECT t.typname,t.oid FROM pg_catalog.pg_type t" +
        " JOIN pg_catalog.pg_namespace n ON (t.typnamespace = n.oid) " +
        " WHERE n.nspname != 'pg_toast'";
View Full Code Here

Examples of com.impossibl.postgres.protocol.ResultField

    fields[1] = rs.getResultFields().get(1);
    fields[2] = rs.getResultFields().get(2);
    fields[3] = rs.getResultFields().get(3);
    fields[4] = rs.getResultFields().get(4);
    fields[5] = rs.getResultFields().get(5);
    fields[6] = new ResultField("BASE_TYPE", 0, (short)0, reg.loadType("int2"), (short)0, 0, Format.Binary);

    List<Object[]> results = new ArrayList<>();
    while (rs.next()) {

      Object[] row = new Object[7];
View Full Code Here

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

Examples of com.impossibl.postgres.protocol.ResultField

    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

Examples of com.impossibl.postgres.protocol.ResultField

    }

    //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

Examples of com.impossibl.postgres.protocol.ResultField

          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

Examples of com.impossibl.postgres.protocol.ResultField

        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

Examples of com.impossibl.postgres.protocol.ResultField

      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
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.