Package org.jruby.pg.internal

Examples of org.jruby.pg.internal.ResultSet


    /******     PG::Connection INSTANCE METHODS: Command Execution     ******/

    @JRubyMethod(alias = {"query", "async_exec", "async_query"}, required = 1, optional = 2)
    public IRubyObject exec(ThreadContext context, IRubyObject[] args, Block block) {
        PostgresqlString query = rubyStringAsPostgresqlString(args[0]);
        ResultSet set = null;
        try {
            if (args.length == 1) {
              set = postgresqlConnection.exec(query);
            } else {

View Full Code Here


          oids = new int[array.getLength()];
          for (int i = 0; i < oids.length; i++)
            oids[i] = (int) ((RubyFixnum) array.get(i)).getLongValue();
        }
        oids = oids == null ? new int [0] : oids;
        ResultSet result = postgresqlConnection.prepare(name, query, oids);
        return createResult(context, result, NULL_ARRAY, Block.NULL_BLOCK);
      } catch (PostgresqlException e) {
        throw newPgError(context, e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
      } catch (Exception e) {
        throw newPgError(context, e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
View Full Code Here

    }

    @JRubyMethod(required = 1, optional = 2)
    public IRubyObject exec_prepared(ThreadContext context, IRubyObject[] args, Block block) {
      try {
        ResultSet set = execPreparedCommon(context, args, false);
        return createResult(context, set, args, block);
      } catch (PostgresqlException e) {
        throw newPgError(context, e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
      } catch (Exception e) {
        throw newPgError(context, e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
View Full Code Here

    @JRubyMethod(required = 1)
    public IRubyObject describe_prepared(ThreadContext context, IRubyObject query_name) {
      try {
        PostgresqlString queryName = rubyStringAsPostgresqlString(query_name);
        ResultSet resultSet = postgresqlConnection.describePrepared(queryName);
        return createResult(context, resultSet, NULL_ARRAY, Block.NULL_BLOCK);
      } catch (PostgresqlException e) {
        throw newPgError(context, e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
      } catch (Exception e) {
        throw newPgError(context, e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
View Full Code Here

    @JRubyMethod(required = 1)
    public IRubyObject describe_portal(ThreadContext context, IRubyObject arg0) {
      try {
        PostgresqlString name = rubyStringAsPostgresqlString(arg0);
        ResultSet resultSet = postgresqlConnection.describePortal(name);
        return createResult(context, resultSet, NULL_ARRAY, Block.NULL_BLOCK);
      } catch (PostgresqlException e) {
        throw newPgError(context, e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
      } catch (Exception e) {
        throw newPgError(context, e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
View Full Code Here

      }
    }

    @JRubyMethod
    public IRubyObject make_empty_pgresult(ThreadContext context, IRubyObject arg0) {
      return createResult(context, new ResultSet(), NULL_ARRAY, Block.NULL_BLOCK);
    }
View Full Code Here

    }

    @JRubyMethod
    public IRubyObject get_result(ThreadContext context, Block block) {
      try {
        ResultSet set = postgresqlConnection.getResult();
        return createResult(context, set, NULL_ARRAY, block);
      } catch (Exception e) {
        throw newPgError(context, e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
      }
    }
View Full Code Here

    }

    @JRubyMethod
    public IRubyObject get_last_result(ThreadContext context) {
      try {
        ResultSet set = postgresqlConnection.getLastResult();
        return createResult(context, set, NULL_ARRAY, Block.NULL_BLOCK);
      } catch (Exception e) {
        throw newPgError(context, e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
      }
    }
View Full Code Here

TOP

Related Classes of org.jruby.pg.internal.ResultSet

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.