Class DB2Connection

All Implemented Interfaces:
MutinyDelegate

public class DB2Connection extends SqlConnection implements MutinyDelegate
A connection to DB2 server.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

See Also:
  • DB2Connection
  • Field Details

  • Constructor Details

    • DB2Connection

      public DB2Connection(io.vertx.db2client.DB2Connection delegate)
      Create a new instance of DB2Connection delegating to the given (non-null) instance of DB2Connection.
    • DB2Connection

      public DB2Connection(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.db2client.DB2Connection getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Overrides:
      getDelegate in class SqlConnection
      Returns:
      the delegate instance
    • connect

      @CheckReturnValue public static io.smallrye.mutiny.Uni<DB2Connection> connect(Vertx vertx, io.vertx.db2client.DB2ConnectOptions connectOptions)
      Create a connection to DB2 server with the given connectOptions.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      vertx - the vertx instance
      connectOptions - the options for the connection
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • io.vertx.db2client.DB2Connection#connect(Vertx, DB2ConnectOptions)
    • connectAndAwait

      public static DB2Connection connectAndAwait(Vertx vertx, io.vertx.db2client.DB2ConnectOptions connectOptions)
      Create a connection to DB2 server with the given connectOptions.

      Unlike the bare Vert.x variant, this method returns a DB2Connection. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      vertx - the vertx instance
      connectOptions - the options for the connection
      Returns:
      The operation result
      See Also:
      • io.vertx.db2client.DB2Connection#connect(Vertx, DB2ConnectOptions)
    • connectAndForget

      public static void connectAndForget(Vertx vertx, io.vertx.db2client.DB2ConnectOptions connectOptions)
      Create a connection to DB2 server with the given connectOptions.

      Unlike the bare Vert.x variant, this method ignores the DB2Connection result or any failure.

      Parameters:
      vertx - the vertx instance
      connectOptions - the options for the connection
      See Also:
      • io.vertx.db2client.DB2Connection#connect(Vertx, DB2ConnectOptions)
    • connect

      @CheckReturnValue public static io.smallrye.mutiny.Uni<DB2Connection> connect(Vertx vertx, String connectionUri)
      Like connect(Vertx, DB2ConnectOptions) with options build from connectionUri.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • io.vertx.db2client.DB2Connection#connect(Vertx, String)
    • connectAndAwait

      public static DB2Connection connectAndAwait(Vertx vertx, String connectionUri)
      Like connect(Vertx, DB2ConnectOptions) with options build from connectionUri.

      Unlike the bare Vert.x variant, this method returns a DB2Connection. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • io.vertx.db2client.DB2Connection#connect(Vertx, String)
    • connectAndForget

      public static void connectAndForget(Vertx vertx, String connectionUri)
      Like connect(Vertx, DB2ConnectOptions) with options build from connectionUri.

      Unlike the bare Vert.x variant, this method ignores the DB2Connection result or any failure.

      See Also:
      • io.vertx.db2client.DB2Connection#connect(Vertx, String)
    • ping

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> ping()
      Send a PING command to check if the server is alive.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • DB2Connection.ping()
    • pingAndAwait

      public void pingAndAwait()
      Send a PING command to check if the server is alive.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • DB2Connection.ping()
    • pingAndForget

      public DB2Connection pingAndForget()
      Send a PING command to check if the server is alive.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • DB2Connection.ping()
    • debug

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> debug()
      Send a DEBUG command to dump debug information to the server's stdout.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • DB2Connection.debug()
    • debugAndAwait

      public void debugAndAwait()
      Send a DEBUG command to dump debug information to the server's stdout.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • DB2Connection.debug()
    • debugAndForget

      public DB2Connection debugAndForget()
      Send a DEBUG command to dump debug information to the server's stdout.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • DB2Connection.debug()
    • prepare

      @CheckReturnValue public io.smallrye.mutiny.Uni<PreparedStatement> prepare(String sql, io.vertx.sqlclient.PrepareOptions options)
      Create a prepared statement using the given sql string.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      prepare in class SqlConnection
      Parameters:
      sql - the sql
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlConnection.prepare(String, PrepareOptions)
    • prepareAndAwait

      public PreparedStatement prepareAndAwait(String sql, io.vertx.sqlclient.PrepareOptions options)
      Create a prepared statement using the given sql string.

      Unlike the bare Vert.x variant, this method returns a PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      prepareAndAwait in class SqlConnection
      Parameters:
      sql - the sql
      Returns:
      The operation result
      See Also:
      • SqlConnection.prepare(String, PrepareOptions)
    • prepareAndForget

      public DB2Connection prepareAndForget(String sql, io.vertx.sqlclient.PrepareOptions options)
      Create a prepared statement using the given sql string.

      Unlike the bare Vert.x variant, this method ignores the PreparedStatement result or any failure.

      Overrides:
      prepareAndForget in class SqlConnection
      Parameters:
      sql - the sql
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlConnection.prepare(String, PrepareOptions)
    • prepare

      @CheckReturnValue public io.smallrye.mutiny.Uni<PreparedStatement> prepare(String sql)
      Create a prepared statement using the given sql string.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      prepare in class SqlConnection
      Parameters:
      sql - the sql
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlConnection.prepare(String)
    • prepareAndAwait

      public PreparedStatement prepareAndAwait(String sql)
      Create a prepared statement using the given sql string.

      Unlike the bare Vert.x variant, this method returns a PreparedStatement. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      prepareAndAwait in class SqlConnection
      Parameters:
      sql - the sql
      Returns:
      The operation result
      See Also:
      • SqlConnection.prepare(String)
    • prepareAndForget

      public DB2Connection prepareAndForget(String sql)
      Create a prepared statement using the given sql string.

      Unlike the bare Vert.x variant, this method ignores the PreparedStatement result or any failure.

      Overrides:
      prepareAndForget in class SqlConnection
      Parameters:
      sql - the sql
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlConnection.prepare(String)
    • begin

      @CheckReturnValue public io.smallrye.mutiny.Uni<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.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      begin in class SqlConnection
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlConnection.begin()
    • beginAndAwait

      public Transaction beginAndAwait()
      Begin a transaction and returns a Transaction for controlling and tracking this transaction.

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

      Unlike the bare Vert.x variant, this method returns a Transaction. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      beginAndAwait in class SqlConnection
      Returns:
      The operation result
      See Also:
      • SqlConnection.begin()
    • beginAndForget

      public DB2Connection beginAndForget()
      Begin a transaction and returns a Transaction for controlling and tracking this transaction.

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

      Unlike the bare Vert.x variant, this method ignores the Transaction result or any failure.

      Overrides:
      beginAndForget in class SqlConnection
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlConnection.begin()
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Close the client and release the associated resources.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Overrides:
      close in class SqlConnection
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • SqlClient.close()
    • closeAndAwait

      public void closeAndAwait()
      Close the client and release the associated resources.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Overrides:
      closeAndAwait in class SqlConnection
      See Also:
      • SqlClient.close()
    • closeAndForget

      public DB2Connection closeAndForget()
      Close the client and release the associated resources.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Overrides:
      closeAndForget in class SqlConnection
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • SqlClient.close()
    • exceptionHandler

      public DB2Connection exceptionHandler(Consumer<Throwable> handler)
      Description copied from class: SqlConnection
      Set an handler called with connection errors.
      Overrides:
      exceptionHandler in class SqlConnection
      Parameters:
      handler - the handler
      Returns:
      a reference to this, so the API can be used fluently
    • closeHandler

      public DB2Connection closeHandler(Runnable handler)
      Description copied from class: SqlConnection
      Set an handler called when the connection is closed.
      Overrides:
      closeHandler in class SqlConnection
      Parameters:
      handler - the handler
      Returns:
      a reference to this, so the API can be used fluently
    • cast

      public 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
    • newInstance

      public static DB2Connection newInstance(io.vertx.db2client.DB2Connection delegate)
      Creates a new instance of the DB2Connection.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SqlConnection
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class SqlConnection
    • toString

      public String toString()
      Overrides:
      toString in class SqlConnection