Class List Method List File List

# Class: VertxJdbc::JDBCClient

Inherits:
  Object
  - Object
  - VertxJdbc::JDBCClient
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb

## Class Method Summary (collapse)

- + (Object) create_non_shared(vertx = nil, config = nil)
- + (Object) create_shared(vertx = nil, config = nil, dataSourceName = nil)

## Instance Method Summary (collapse)

- - (Object) close
- - (Object) get_connection
- - (JDBCClient) initialize(j_del) constructor
  A new instance of JDBCClient.
- - (Object) j_del

## Constructor Details

### - (`JDBCClient`) initialize(j_del)

Returns a new instance of JDBCClient

    10
    11
    12
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb', line 10

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create_non_shared(vertx = nil, config = nil)

Raises:

- (`ArgumentError`)

    22
    23
    24
    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb', line 22

    def self.create_non_shared(vertx=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtJdbc::JDBCClient.java_method(:createNonShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxJdbc::JDBCClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_non_shared(vertx,config)"
    end

### + (`Object`) create_shared(vertx = nil, config = nil, dataSourceName = nil)

Raises:

- (`ArgumentError`)

    34
    35
    36
    37
    38
    39
    40
    41
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb', line 34

    def self.create_shared(vertx=nil,config=nil,dataSourceName=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? && dataSourceName == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtJdbc::JDBCClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxJdbc::JDBCClient)
      elsif vertx.class.method_defined?(:j_del) && config.class == Hash && dataSourceName.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtJdbc::JDBCClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config),dataSourceName),::VertxJdbc::JDBCClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_shared(vertx,config,dataSourceName)"
    end

## Instance Method Details

### - (`Object`) close

Raises:

- (`ArgumentError`)

    55
    56
    57
    58
    59
    60
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb', line 55

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`Object`) get_connection

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb', line 46

    def get_connection
      if block_given?
        @j_del.java_method(:getConnection, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSql::SQLConnection) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling get_connection()"
    end

### - (`Object`) j_del

    15
    16
    17
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-jdbc/jdbc_client.rb', line 15

    def j_del
      @j_del
    end