io.vertx.rxjava.sqlclient

## Class Pool

- java.lang.Object
- - io.vertx.rxjava.sqlclient.SqlClient
  - - io.vertx.rxjava.sqlclient.Pool

- Direct Known Subclasses:
    DB2Pool, JDBCPool, MySQLPool, PgPool

      public class Pool
      extends SqlClient

  A connection pool which reuses a number of SQL connections.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<Pool>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Pool(Object delegate)`
    `Pool(Pool delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the pool and release the associated resources.
    `void` | `close(Handler<AsyncResult<Void>> handler)` Close the pool and release the associated resources.
    `boolean` | `equals(Object o)`
    `void` | `getConnection()` Get a connection from the pool.
    `void` | `getConnection(Handler<AsyncResult<SqlConnection>> handler)` Get a connection from the pool.
    `Pool` | `getDelegate()`
    `int` | `hashCode()`
    `static Pool` | `newInstance(Pool arg)`
    `static Pool` | `pool(SqlConnectOptions connectOptions)` Create a connection pool to the database configured with the given `connectOptions` and default `PoolOptions`
    `static Pool` | `pool(SqlConnectOptions connectOptions, PoolOptions poolOptions)` Create a connection pool to the database configured with the given `connectOptions` and `poolOptions`.
    `static Pool` | `pool(Vertx vertx, SqlConnectOptions connectOptions, PoolOptions poolOptions)` Create a connection pool to the database configured with the given `connectOptions` and `poolOptions`.
    `PreparedQuery<RowSet<Row>>` | `preparedQuery(String sql)` A connection is borrowed from the connection pool when the query is executed and then immediately returned to the pool after it completes.
    `Query<RowSet<Row>>` | `query(String sql)` A connection is borrowed from the connection pool when the query is executed and then immediately returned to the pool after it completes.
    `Single<Void>` | `rxClose()` Close the pool and release the associated resources.
    `Single<SqlConnection>` | `rxGetConnection()` Get a connection from the pool.
    `<T> Single<T>` | `rxWithTransaction(java.util.function.Function<SqlClient,Future<T>> function)` Execute the given `function` within a transaction.
    `String` | `toString()`
    `<T> void` | `withTransaction(java.util.function.Function<SqlClient,Future<T>> function)` Execute the given `function` within a transaction.
    `<T> void` | `withTransaction(java.util.function.Function<SqlClient,Future<T>> function, Handler<AsyncResult<T>> handler)` Execute the given `function` within a transaction.

    - ### Methods inherited from class io.vertx.rxjava.sqlclient.SqlClient

      `newInstance`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<Pool> __TYPE_ARG

  - ### Constructor Detail

    - #### Pool

          public Pool(Pool delegate)

    - #### Pool

          public Pool(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `SqlClient`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `SqlClient`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `SqlClient`

    - #### getDelegate

          public Pool getDelegate()

      Overrides:
        `getDelegate` in class `SqlClient`

    - #### pool

          public static Pool pool(SqlConnectOptions connectOptions)

      Create a connection pool to the database configured with the given `connectOptions` and default `PoolOptions`
      Parameters:
        `connectOptions` - the options used to create the connection pool, such as database hostname
      Returns:
        the connection pool

    - #### pool

          public static Pool pool(SqlConnectOptions connectOptions,
                                  PoolOptions poolOptions)

      Create a connection pool to the database configured with the given `connectOptions` and `poolOptions`.
      Parameters:
        `connectOptions` - the options used to create the connection pool, such as database hostname
        `poolOptions` - the options for creating the pool
      Returns:
        the connection pool

    - #### pool

          public static Pool pool(Vertx vertx,
                                  SqlConnectOptions connectOptions,
                                  PoolOptions poolOptions)

      Create a connection pool to the database configured with the given `connectOptions` and `poolOptions`.
      Parameters:
        `vertx` - the Vertx instance to be used with the connection pool
        `connectOptions` - the options used to create the connection pool, such as database hostname
        `poolOptions` - the options for creating the pool
      Returns:
        the connection pool

    - #### getConnection

          public void getConnection(Handler<AsyncResult<SqlConnection>> handler)

      Get a connection from the pool.
      Parameters:
        `handler` - the handler that will get the connection result

    - #### getConnection

          public void getConnection()

      Get a connection from the pool.

    - #### rxGetConnection

          public Single<SqlConnection> rxGetConnection()

      Get a connection from the pool.
      Returns:

    - #### query

          public Query<RowSet<Row>> query(String sql)

      A connection is borrowed from the connection pool when the query is executed and then immediately returned to the pool after it completes.
      Overrides:
        `query` in class `SqlClient`
      Parameters:
        `sql` -
      Returns:

    - #### preparedQuery

          public PreparedQuery<RowSet<Row>> preparedQuery(String sql)

      A connection is borrowed from the connection pool when the query is executed and then immediately returned to the pool after it completes.
      Overrides:
        `preparedQuery` in class `SqlClient`
      Parameters:
        `sql` -
      Returns:

    - #### withTransaction

          public <T> void withTransaction(java.util.function.Function<SqlClient,Future<T>> function,
                                          Handler<AsyncResult<T>> handler)

      Execute the given `function` within a transaction.

      The `function` is passed a client executing all operations within a transaction. When the future returned by the function

      - succeeds the transaction commits
      - fails the transaction rollbacks

      The `handler` is given a success result when the function returns a succeeded futures and the transaction commits. Otherwise it is given a failure result.

      Parameters:
        `function` - the code to execute
        `handler` - the result handler

    - #### withTransaction

          public <T> void withTransaction(java.util.function.Function<SqlClient,Future<T>> function)

      Execute the given `function` within a transaction.

      The `function` is passed a client executing all operations within a transaction. When the future returned by the function

      - succeeds the transaction commits
      - fails the transaction rollbacks

      The `handler` is given a success result when the function returns a succeeded futures and the transaction commits. Otherwise it is given a failure result.

      Parameters:
        `function` - the code to execute

    - #### rxWithTransaction

          public <T> Single<T> rxWithTransaction(java.util.function.Function<SqlClient,Future<T>> function)

      Execute the given `function` within a transaction.

      The `function` is passed a client executing all operations within a transaction. When the future returned by the function

      - succeeds the transaction commits
      - fails the transaction rollbacks

      The `handler` is given a success result when the function returns a succeeded futures and the transaction commits. Otherwise it is given a failure result.

      Parameters:
        `function` - the code to execute
      Returns:

    - #### close

          public void close(Handler<AsyncResult<Void>> handler)

      Close the pool and release the associated resources.
      Overrides:
        `close` in class `SqlClient`
      Parameters:
        `handler` - the completion handler

    - #### close

          public void close()

      Close the pool and release the associated resources.
      Overrides:
        `close` in class `SqlClient`

    - #### rxClose

          public Single<Void> rxClose()

      Close the pool and release the associated resources.
      Overrides:
        `rxClose` in class `SqlClient`
      Returns:

    - #### newInstance

          public static Pool newInstance(Pool arg)

Copyright © 2020 Eclipse. All rights reserved.