Package org.jruby.pg.internal

Examples of org.jruby.pg.internal.LargeObjectAPI


    /******     PG::Connection INSTANCE METHODS: Large Object Support     ******/

    @JRubyMethod(name = {"lo_creat", "locreat"}, optional = 1)
    public IRubyObject lo_creat(ThreadContext context, IRubyObject[] args) {
      try {
        LargeObjectAPI manager = postgresqlConnection.getLargeObjectAPI();
        int oid;
        if (args.length == 1)
          oid = manager.loCreat((Integer) args[0].toJava(Integer.class));
        else
          oid = manager.loCreat(0);
        return new RubyFixnum(context.runtime, oid);
      } catch (PostgresqlException e) {
        throw newPgError(context, "lo_create failed: " + e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
      } catch (IOException e) {
        throw newPgError(context, "lo_create failed: " + e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
View Full Code Here


    }

    @JRubyMethod(name = {"lo_create", "locreate"})
    public IRubyObject lo_create(ThreadContext context, IRubyObject arg0) {
      try {
        LargeObjectAPI manager = postgresqlConnection.getLargeObjectAPI();
        int oid = manager.loCreate((Integer) arg0.toJava(Integer.class));
        return new RubyFixnum(context.runtime, oid);
      } catch (PostgresqlException e) {
        throw newPgError(context, "lo_create failed: " + e.getLocalizedMessage(), e.getResultSet(), getClientEncodingAsJavaEncoding(context));
      } catch (IOException e) {
        throw newPgError(context, "lo_create failed: " + e.getLocalizedMessage(), null, getClientEncodingAsJavaEncoding(context));
View Full Code Here

TOP

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

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.