Package io.vertx.db2client

## Interface DB2Connection

- All Superinterfaces:
    `SqlClient`, `SqlConnection`

      public interface DB2Connection
      extends SqlConnection

  A connection to DB2 server.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static DB2Connection` | `cast​(SqlConnection sqlConnection)` | Cast a `SqlConnection` to `DB2Connection`.
    `DB2Connection` | `closeHandler​(Handler<Void> handler)` | Set an handler called when the connection is closed.
    `static Future<DB2Connection>` | `connect​(Vertx vertx, DB2ConnectOptions connectOptions)` | Create a connection to DB2 server with the given `connectOptions`.
    `static Future<DB2Connection>` | `connect​(Vertx vertx, String connectionUri)` | Like `connect(Vertx, DB2ConnectOptions)` with options build from `connectionUri`.
    `Future<Void>` | `debug()` | Send a DEBUG command to dump debug information to the server's stdout.
    `DB2Connection` | `exceptionHandler​(Handler<Throwable> handler)` | Set an handler called with connection errors.
    `Future<Void>` | `ping()` | Send a PING command to check if the server is alive.

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

      `close, preparedQuery, preparedQuery, query`

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

      `begin, databaseMetadata, isSSL, prepare, prepare, transaction`

- - ### Method Detail

    - #### connect

          static Future<DB2Connection> connect​(Vertx vertx,
                                               DB2ConnectOptions connectOptions)

      Create a connection to DB2 server with the given `connectOptions`.
      Parameters:
        `vertx` - the vertx instance
        `connectOptions` - the options for the connection
      Returns:
        a future notified with the connection or the failure

    - #### connect

          static Future<DB2Connection> connect​(Vertx vertx,
                                               String connectionUri)

      Like `connect(Vertx, DB2ConnectOptions)` with options build from `connectionUri`.

    - #### exceptionHandler

          DB2Connection exceptionHandler​(Handler<Throwable> handler)

      Description copied from interface: `SqlConnection`
      Set an handler called with connection errors.
      Specified by:
        `exceptionHandler` in interface `SqlConnection`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### closeHandler

          DB2Connection closeHandler​(Handler<Void> handler)

      Description copied from interface: `SqlConnection`
      Set an handler called when the connection is closed.
      Specified by:
        `closeHandler` in interface `SqlConnection`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### ping

          Future<Void> ping()

      Send a PING command to check if the server is alive.
      Returns:
        a future notified with the server response

    - #### debug

          Future<Void> debug()

      Send a DEBUG command to dump debug information to the server's stdout.
      Returns:
        a future notified with the execution result

    - #### cast

          static DB2Connection cast​(SqlConnection sqlConnection)

      Cast a `SqlConnection` to `DB2Connection`. This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.
      Parameters:
        `sqlConnection` - the connection to cast
      Returns:
        a `instance`