Class List Method List File List

# Class: VertxSql::SQLConnection

Inherits:
  Object
  - Object
  - VertxSql::SQLConnection
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb

## Instance Method Summary (collapse)

- - (Object) batch(sqlStatements = nil)
- - (Object) batch_callable_with_params(sqlStatement = nil, inArgs = nil, outArgs = nil)
- - (Object) batch_with_params(sqlStatement = nil, args = nil)
- - (Object) call(sql = nil)
- - (Object) call_with_params(sql = nil, params = nil, outputs = nil)
- - (Object) close
- - (Object) commit
- - (Object) execute(sql = nil)
- - (Object) get_transaction_isolation
- - (SQLConnection) initialize(j_del) constructor
  A new instance of SQLConnection.
- - (Object) j_del
- - (Object) query(sql = nil)
- - (Object) query_with_params(sql = nil, params = nil)
- - (Object) rollback
- - (Object) set_auto_commit(autoCommit = nil)
- - (Object) set_query_timeout(timeoutInSeconds = nil)
- - (Object) set_transaction_isolation(isolation = nil)
- - (Object) update(sql = nil)
- - (Object) update_with_params(sql = nil, params = nil)

## Constructor Details

### - (`SQLConnection`) initialize(j_del)

Returns a new instance of SQLConnection

    8
    9
    10
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 8

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) batch(sqlStatements = nil)

Raises:

- (`ArgumentError`)

    165
    166
    167
    168
    169
    170
    171
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 165

    def batch(sqlStatements=nil)
      if sqlStatements.class == Array && block_given?
        @j_del.java_method(:batch, [Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(sqlStatements.map { |element| element },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling batch(sqlStatements)"
    end

### - (`Object`) batch_callable_with_params(sqlStatement = nil, inArgs = nil, outArgs = nil)

Raises:

- (`ArgumentError`)

    193
    194
    195
    196
    197
    198
    199
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 193

    def batch_callable_with_params(sqlStatement=nil,inArgs=nil,outArgs=nil)
      if sqlStatement.class == String && inArgs.class == Array && outArgs.class == Array && block_given?
        @j_del.java_method(:batchCallableWithParams, [Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(sqlStatement,inArgs.map { |element| ::Vertx::Util::Utils.to_json_array(element) },outArgs.map { |element| ::Vertx::Util::Utils.to_json_array(element) },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling batch_callable_with_params(sqlStatement,inArgs,outArgs)"
    end

### - (`Object`) batch_with_params(sqlStatement = nil, args = nil)

Raises:

- (`ArgumentError`)

    178
    179
    180
    181
    182
    183
    184
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 178

    def batch_with_params(sqlStatement=nil,args=nil)
      if sqlStatement.class == String && args.class == Array && block_given?
        @j_del.java_method(:batchWithParams, [Java::java.lang.String.java_class,Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(sqlStatement,args.map { |element| ::Vertx::Util::Utils.to_json_array(element) },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling batch_with_params(sqlStatement,args)"
    end

### - (`Object`) call(sql = nil)

Raises:

- (`ArgumentError`)

    90
    91
    92
    93
    94
    95
    96
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 90

    def call(sql=nil)
      if sql.class == String && block_given?
        @j_del.java_method(:call, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling call(sql)"
    end

### - (`Object`) call_with_params(sql = nil, params = nil, outputs = nil)

Raises:

- (`ArgumentError`)

    111
    112
    113
    114
    115
    116
    117
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 111

    def call_with_params(sql=nil,params=nil,outputs=nil)
      if sql.class == String && params.class == Array && outputs.class == Array && block_given?
        @j_del.java_method(:callWithParams, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonArray.java_class,Java::IoVertxCoreJson::JsonArray.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,::Vertx::Util::Utils.to_json_array(params),::Vertx::Util::Utils.to_json_array(outputs),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling call_with_params(sql,params,outputs)"
    end

### - (`Object`) close

Raises:

- (`ArgumentError`)

    121
    122
    123
    124
    125
    126
    127
    128
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 121

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      elsif block_given?
        return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`Object`) commit

Raises:

- (`ArgumentError`)

    132
    133
    134
    135
    136
    137
    138
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 132

    def commit
      if block_given?
        @j_del.java_method(:commit, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling commit()"
    end

### - (`Object`) execute(sql = nil)

Raises:

- (`ArgumentError`)

    31
    32
    33
    34
    35
    36
    37
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 31

    def execute(sql=nil)
      if sql.class == String && block_given?
        @j_del.java_method(:execute, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling execute(sql)"
    end

### - (`Object`) get_transaction_isolation

Raises:

- (`ArgumentError`)

    216
    217
    218
    219
    220
    221
    222
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 216

    def get_transaction_isolation
      if block_given?
        @j_del.java_method(:getTransactionIsolation, [Java::IoVertxCore::Handler.java_class]).call(nil)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling get_transaction_isolation()"
    end

### - (`Object`) j_del

    13
    14
    15
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 13

    def j_del
      @j_del
    end

### - (`Object`) query(sql = nil)

Raises:

- (`ArgumentError`)

    42
    43
    44
    45
    46
    47
    48
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 42

    def query(sql=nil)
      if sql.class == String && block_given?
        @j_del.java_method(:query, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling query(sql)"
    end

### - (`Object`) query_with_params(sql = nil, params = nil)

Raises:

- (`ArgumentError`)

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

    def query_with_params(sql=nil,params=nil)
      if sql.class == String && params.class == Array && block_given?
        @j_del.java_method(:queryWithParams, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonArray.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,::Vertx::Util::Utils.to_json_array(params),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling query_with_params(sql,params)"
    end

### - (`Object`) rollback

Raises:

- (`ArgumentError`)

    142
    143
    144
    145
    146
    147
    148
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 142

    def rollback
      if block_given?
        @j_del.java_method(:rollback, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling rollback()"
    end

### - (`Object`) set_auto_commit(autoCommit = nil)

Raises:

- (`ArgumentError`)

    20
    21
    22
    23
    24
    25
    26
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 20

    def set_auto_commit(autoCommit=nil)
      if (autoCommit.class == TrueClass || autoCommit.class == FalseClass) && block_given?
        @j_del.java_method(:setAutoCommit, [Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(autoCommit,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_auto_commit(autoCommit)"
    end

### - (`Object`) set_query_timeout(timeoutInSeconds = nil)

Raises:

- (`ArgumentError`)

    154
    155
    156
    157
    158
    159
    160
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 154

    def set_query_timeout(timeoutInSeconds=nil)
      if timeoutInSeconds.class == Fixnum && !block_given?
        @j_del.java_method(:setQueryTimeout, [Java::int.java_class]).call(timeoutInSeconds)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_query_timeout(timeoutInSeconds)"
    end

### - (`Object`) set_transaction_isolation(isolation = nil)

Raises:

- (`ArgumentError`)

    206
    207
    208
    209
    210
    211
    212
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 206

    def set_transaction_isolation(isolation=nil)
      if isolation.class == Symbol && block_given?
        @j_del.java_method(:setTransactionIsolation, [Java::IoVertxExtSql::TransactionIsolation.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxExtSql::TransactionIsolation.valueOf(isolation),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_transaction_isolation(isolation)"
    end

### - (`Object`) update(sql = nil)

Raises:

- (`ArgumentError`)

    66
    67
    68
    69
    70
    71
    72
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 66

    def update(sql=nil)
      if sql.class == String && block_given?
        @j_del.java_method(:update, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update(sql)"
    end

### - (`Object`) update_with_params(sql = nil, params = nil)

Raises:

- (`ArgumentError`)

    79
    80
    81
    82
    83
    84
    85
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-sql/sql_connection.rb', line 79

    def update_with_params(sql=nil,params=nil)
      if sql.class == String && params.class == Array && block_given?
        @j_del.java_method(:updateWithParams, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonArray.java_class,Java::IoVertxCore::Handler.java_class]).call(sql,::Vertx::Util::Utils.to_json_array(params),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update_with_params(sql,params)"
    end