Class List Method List File List

# Class: VertxSqlClient::SqlClient

Inherits:
  Object
  - Object
  - VertxSqlClient::SqlClient
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb

## Overview

Defines the client operations with a database server.

## Direct Known Subclasses

Pool, SqlConnection, Transaction

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) close
  Close the client and release the associated resources.
- - (::VertxSqlClient::PreparedQuery) prepared_query(sql = nil)
  Create a prepared query, one of the Query#execute or PreparedQuery#execute_batch methods must be called to execute the query.
- - (::VertxSqlClient::Query) query(sql = nil)
  Create a query, the Query#execute method must be called to execute the query.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 21

    def @@j_api_type.accept?(obj)
      obj.class == SqlClient
    end

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 30

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    33
    34
    35
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 33

    def self.j_class
      Java::IoVertxSqlclient::SqlClient.java_class
    end

### + (`Object`) unwrap(obj)

    27
    28
    29
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 27

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    24
    25
    26
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 24

    def @@j_api_type.wrap(obj)
      SqlClient.new(obj)
    end

## Instance Method Details

### - (`void`) close

This method returns an undefined value.

Close the client and release the associated resources.

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 57

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

### - (`::VertxSqlClient::PreparedQuery`) prepared_query(sql = nil)

Create a prepared query, one of the Query#execute or PreparedQuery#execute_batch methods must be called to execute the query.

Parameters:

- sql (`String`) (defaults to: `nil`)

Returns:

- (`::VertxSqlClient::PreparedQuery`) —
  the prepared query

Raises:

- (`ArgumentError`)

    49
    50
    51
    52
    53
    54
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 49

    def prepared_query(sql=nil)
      if sql.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:preparedQuery, [Java::java.lang.String.java_class]).call(sql),::VertxSqlClient::PreparedQuery,::VertxSqlClient::RowSet.j_api_type)
      end
      raise ArgumentError, "Invalid arguments when calling prepared_query(#{sql})"
    end

### - (`::VertxSqlClient::Query`) query(sql = nil)

Create a query, the Query#execute method must be called to execute the query.

Parameters:

- sql (`String`) (defaults to: `nil`)

Returns:

- (`::VertxSqlClient::Query`) —
  the query

Raises:

- (`ArgumentError`)

    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/sql_client.rb', line 39

    def query(sql=nil)
      if sql.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:query, [Java::java.lang.String.java_class]).call(sql),::VertxSqlClient::Query,::VertxSqlClient::RowSet.j_api_type)
      end
      raise ArgumentError, "Invalid arguments when calling query(#{sql})"
    end