io.vertx.sqlclient

## Interface Pool

- All Superinterfaces:
    SqlClient
  All Known Subinterfaces:
    MySQLPool, PgPool

      public interface Pool
      extends SqlClient

  A pool of SQL connections.
  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `begin(Handler<AsyncResult<Transaction>> handler)` Borrow a connection from the pool and begin a transaction, the underlying connection will be returned to the pool when the transaction ends.
    `void` | `close()` Close the pool and release the associated resources.
    `void` | `getConnection(Handler<AsyncResult<SqlConnection>> handler)` Get a connection from the pool.
    `<R> Pool` | `preparedBatch(String sql, List<Tuple> batch, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Prepare and execute a createBatch.
    `Pool` | `preparedBatch(String sql, List<Tuple> batch, Handler<AsyncResult<RowSet<Row>>> handler)` Prepare and execute a createBatch.
    `<R> Pool` | `preparedQuery(String sql, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Prepare and execute a query.
    `Pool` | `preparedQuery(String sql, Handler<AsyncResult<RowSet<Row>>> handler)` Prepare and execute a query.
    `<R> Pool` | `preparedQuery(String sql, Tuple arguments, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Prepare and execute a query.
    `Pool` | `preparedQuery(String sql, Tuple arguments, Handler<AsyncResult<RowSet<Row>>> handler)` Prepare and execute a query.
    `<R> Pool` | `query(String sql, java.util.stream.Collector<Row,?,R> collector, Handler<AsyncResult<SqlResult<R>>> handler)` Execute a simple query.
    `Pool` | `query(String sql, Handler<AsyncResult<RowSet<Row>>> handler)` Execute a simple query.

- - ### Method Detail

    - #### preparedQuery

          Pool preparedQuery(String sql,
                             Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          <R> Pool preparedQuery(String sql,
                                 java.util.stream.Collector<Row,?,R> collector,
                                 Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### query

          Pool query(String sql,
                     Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Execute a simple query.
      Specified by:
        `query` in interface `SqlClient`
      Parameters:
        `sql` - the query SQL
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### query

          <R> Pool query(String sql,
                         java.util.stream.Collector<Row,?,R> collector,
                         Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Execute a simple query.
      Specified by:
        `query` in interface `SqlClient`
      Parameters:
        `sql` - the query SQL
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          Pool preparedQuery(String sql,
                             Tuple arguments,
                             Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `arguments` - the list of arguments
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          <R> Pool preparedQuery(String sql,
                                 Tuple arguments,
                                 java.util.stream.Collector<Row,?,R> collector,
                                 Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a query.
      Specified by:
        `preparedQuery` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `arguments` - the list of arguments
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedBatch

          Pool preparedBatch(String sql,
                             List<Tuple> batch,
                             Handler<AsyncResult<RowSet<Row>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a createBatch.
      Specified by:
        `preparedBatch` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `batch` - the batch of tuples
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedBatch

          <R> Pool preparedBatch(String sql,
                                 List<Tuple> batch,
                                 java.util.stream.Collector<Row,?,R> collector,
                                 Handler<AsyncResult<SqlResult<R>>> handler)

      Description copied from interface: `SqlClient`
      Prepare and execute a createBatch.
      Specified by:
        `preparedBatch` in interface `SqlClient`
      Parameters:
        `sql` - the prepared query SQL
        `batch` - the batch of tuples
        `collector` - the collector
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### getConnection

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

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

    - #### begin

          void begin(Handler<AsyncResult<Transaction>> handler)

      Borrow a connection from the pool and begin a transaction, the underlying connection will be returned to the pool when the transaction ends.

    - #### close

          void close()

      Close the pool and release the associated resources.
      Specified by:
        `close` in interface `SqlClient`

Copyright © 2019 Eclipse. All rights reserved.