Package org.jruby.pg.internal.messages

Examples of org.jruby.pg.internal.messages.RowDescription


      return context.runtime.newFixnum(columns[index].getFormat());
    }

    @JRubyMethod(required = 1, argTypes = {RubyFixnum.class})
    public IRubyObject ftype(ThreadContext context, IRubyObject fieldNumber) {
      RowDescription description = jdbcResultSet.getDescription();
      int field = (int) ((RubyFixnum) fieldNumber).getLongValue();
      if (field >= description.getColumns().length) {
        throw context.runtime.newIndexError("field " + field + " is out of range");
      }
      return context.runtime.newFixnum(description.getColumns()[field].getOid());
    }
View Full Code Here


      return context.nil;
    }

    @JRubyMethod
    public IRubyObject fields(ThreadContext context) {
      RowDescription description = jdbcResultSet.getDescription();
      if (description == null)
        return context.runtime.newArray();
      Column[] columns = description.getColumns();
      RubyArray fields = context.runtime.newArray(columns.length);
      for (int i = 0; i < columns.length; i++)
        fields.append(context.runtime.newString(columns[i].getName()));
      return fields;
    }
View Full Code Here

      break;
    case RowDescription:
      if (inProgress == null)
        inProgress = new ResultSet();
      // fetch the row description
      RowDescription description = (RowDescription) message;
      inProgress.setDescription(description);
      break;
    case DataRow:
      DataRow dataRow = (DataRow) message;
      inProgress.appendRow(dataRow);
View Full Code Here

TOP

Related Classes of org.jruby.pg.internal.messages.RowDescription

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.