io.vertx.sqlclient

## Interface SqlConnection

- All Superinterfaces:
    SqlClient
  All Known Subinterfaces:
    MySQLConnection, PgConnection

      public interface SqlConnection
      extends SqlClient

  A connection to database server.
  Author:
    Julien Viet, Emad Alblueshi

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Transaction` | `begin()` Begin a transaction and returns a `Transaction` for controlling and tracking this transaction.
    `void` | `close()` Close the current connection after all the pending commands have been processed.
    `SqlConnection` | `closeHandler(Handler<Void> handler)` Set an handler called when the connection is closed.
    `SqlConnection` | `exceptionHandler(Handler<Throwable> handler)` Set an handler called with connection errors.
    `boolean` | `isSSL()`
    `SqlConnection` | `prepare(String sql, Handler<AsyncResult<PreparedStatement>> handler)` Create a prepared query.

    - ### Methods inherited from interface io.vertx.sqlclient.SqlClient

      `preparedQuery, query`

- - ### Method Detail

    - #### prepare

          SqlConnection prepare(String sql,
                                Handler<AsyncResult<PreparedStatement>> handler)

      Create a prepared query.
      Parameters:
        `sql` - the sql
        `handler` - the handler notified with the prepared query asynchronously

    - #### exceptionHandler

          SqlConnection exceptionHandler(Handler<Throwable> handler)

      Set an handler called with connection errors.
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### closeHandler

          SqlConnection closeHandler(Handler<Void> handler)

      Set an handler called when the connection is closed.
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### begin

          Transaction begin()

      Begin a transaction and returns a `Transaction` for controlling and tracking this transaction.

      When the connection is explicitely closed, any inflight transaction is rollbacked.
      Returns:
        the transaction instance

    - #### isSSL

          boolean isSSL()

      Returns:
        whether the connection uses SSL

    - #### close

          void close()

      Close the current connection after all the pending commands have been processed.
      Specified by:
        `close` in interface `SqlClient`

Copyright © 2020 Eclipse. All rights reserved.