Class JDBCClient

  • All Implemented Interfaces:
    SQLOperations

    public class JDBCClient
    extends SQLClient
    An asynchronous client interface for interacting with a JDBC compliant database

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

    • Constructor Detail

      • JDBCClient

        public JDBCClient​(io.vertx.ext.jdbc.JDBCClient delegate)
      • JDBCClient

        public JDBCClient​(Object delegate)
    • Method Detail

      • querySingle

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> querySingle​(String sql)
        Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Specified by:
        querySingle in interface SQLOperations
        Overrides:
        querySingle in class SQLClient
        Parameters:
        sql - the statement to execute
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • querySingleAndAwait

        public io.vertx.core.json.JsonArray querySingleAndAwait​(String sql)
        Blocking variant of SQLOperations.querySingle(String).

        This method waits 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).

        Specified by:
        querySingleAndAwait in interface SQLOperations
        Overrides:
        querySingleAndAwait in class SQLClient
        Parameters:
        sql - the statement to execute
        Returns:
        the JsonArray instance produced by the operation.
      • querySingleWithParams

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> querySingleWithParams​(String sql,
                                                                                          io.vertx.core.json.JsonArray arguments)
        Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Specified by:
        querySingleWithParams in interface SQLOperations
        Overrides:
        querySingleWithParams in class SQLClient
        Parameters:
        sql - the statement to execute
        arguments - the arguments
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • querySingleWithParamsAndAwait

        public io.vertx.core.json.JsonArray querySingleWithParamsAndAwait​(String sql,
                                                                          io.vertx.core.json.JsonArray arguments)
        Blocking variant of SQLOperations.querySingleWithParams(String,JsonArray).

        This method waits 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).

        Specified by:
        querySingleWithParamsAndAwait in interface SQLOperations
        Overrides:
        querySingleWithParamsAndAwait in class SQLClient
        Parameters:
        sql - the statement to execute
        arguments - the arguments
        Returns:
        the JsonArray instance produced by the operation.
      • create

        public static JDBCClient create​(Vertx vertx,
                                        io.vertx.core.json.JsonObject config)
        Parameters:
        vertx - the Vert.x instance
        config - the configuration
        Returns:
        the client
      • createShared

        public static JDBCClient createShared​(Vertx vertx,
                                              io.vertx.core.json.JsonObject config,
                                              String dataSourceName)
        Parameters:
        vertx - the Vert.x instance
        config - the configuration
        dataSourceName - the data source name
        Returns:
        the client
      • createShared

        public static JDBCClient createShared​(Vertx vertx,
                                              io.vertx.core.json.JsonObject config)
        Parameters:
        vertx - the Vert.x instance
        config - the configuration
        Returns:
        the client
      • newInstance

        public static JDBCClient newInstance​(io.vertx.ext.jdbc.JDBCClient arg)