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 Default Methods
    Modifier and Type | Method and 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)` Like `connect(Vertx, DB2ConnectOptions, Handler)` but returns a `Future` of the asynchronous result
    `static void` | `connect(Vertx vertx, DB2ConnectOptions connectOptions, Handler<AsyncResult<DB2Connection>> handler)` Create a connection to DB2 server with the given `connectOptions`.
    `static Future<DB2Connection>` | `connect(Vertx vertx, String connectionUri)` Like `connect(Vertx, String, Handler)` but returns a `Future` of the asynchronous result
    `static void` | `connect(Vertx vertx, String connectionUri, Handler<AsyncResult<DB2Connection>> handler)` Like `connect(Vertx, DB2ConnectOptions, Handler)` with options build from `connectionUri`.
    `Future<Void>` | `debug()` Like `debug(Handler)` but returns a `Future` of the asynchronous result
    `DB2Connection` | `debug(Handler<AsyncResult<Void>> handler)` 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()` Like `ping(Handler)` but returns a `Future` of the asynchronous result
    `DB2Connection` | `ping(Handler<AsyncResult<Void>> handler)` Send a PING command to check if the server is alive.
    `DB2Connection` | `prepare(String sql, Handler<AsyncResult<PreparedStatement>> handler)` Create a prepared statement using the given `sql` string.

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

      `begin, begin, close, databaseMetadata, isSSL, prepare`

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

      `close, preparedQuery, query`

- - ### Method Detail

    - #### connect

          static void connect(Vertx vertx,
                              DB2ConnectOptions connectOptions,
                              Handler<AsyncResult<DB2Connection>> handler)

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

    - #### connect

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

      Like `connect(Vertx, DB2ConnectOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### connect

          static void connect(Vertx vertx,
                              String connectionUri,
                              Handler<AsyncResult<DB2Connection>> handler)

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

    - #### connect

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

      Like `connect(Vertx, String, Handler)` but returns a `Future` of the asynchronous result

    - #### prepare

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

      Description copied from interface: `SqlConnection`
      Create a prepared statement using the given `sql` string.
      Specified by:
        `prepare` in interface `SqlConnection`
      Parameters:
        `sql` - the sql
        `handler` - the handler notified with the prepared query asynchronously

    - #### 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

          DB2Connection ping(Handler<AsyncResult<Void>> handler)

      Send a PING command to check if the server is alive.
      Parameters:
        `handler` - the handler notified when the server responses to client
      Returns:
        a reference to this, so the API can be used fluently

    - #### ping

          Future<Void> ping()

      Like `ping(Handler)` but returns a `Future` of the asynchronous result

    - #### debug

          DB2Connection debug(Handler<AsyncResult<Void>> handler)

      Send a DEBUG command to dump debug information to the server's stdout.
      Parameters:
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### debug

          Future<Void> debug()

      Like `debug(Handler)` but returns a `Future` of the asynchronous 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`

Copyright © 2021 Eclipse. All rights reserved.