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 RX-ified interface using Vert.x codegen.

    • Constructor Detail

      • JDBCClient

        public JDBCClient​(JDBCClient delegate)
      • JDBCClient

        public JDBCClient​(Object delegate)
    • Method Detail

      • querySingle

        public SQLOperations querySingle​(String sql,
                                         Handler<AsyncResult<JsonArray>> handler)
        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.
        Specified by:
        querySingle in interface SQLOperations
        Overrides:
        querySingle in class SQLClient
        Parameters:
        sql - the statement to execute
        handler - the result handler
        Returns:
        self
      • querySingle

        public SQLOperations 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.
        Specified by:
        querySingle in interface SQLOperations
        Overrides:
        querySingle in class SQLClient
        Parameters:
        sql - the statement to execute
        Returns:
        self
      • rxQuerySingle

        public io.reactivex.Maybe<JsonArray> rxQuerySingle​(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.
        Specified by:
        rxQuerySingle in interface SQLOperations
        Overrides:
        rxQuerySingle in class SQLClient
        Parameters:
        sql - the statement to execute
        Returns:
        self
      • querySingleWithParams

        public SQLOperations querySingleWithParams​(String sql,
                                                   JsonArray arguments,
                                                   Handler<AsyncResult<JsonArray>> handler)
        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.
        Specified by:
        querySingleWithParams in interface SQLOperations
        Overrides:
        querySingleWithParams in class SQLClient
        Parameters:
        sql - the statement to execute
        arguments - the arguments
        handler - the result handler
        Returns:
        self
      • querySingleWithParams

        public SQLOperations querySingleWithParams​(String sql,
                                                   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.
        Specified by:
        querySingleWithParams in interface SQLOperations
        Overrides:
        querySingleWithParams in class SQLClient
        Parameters:
        sql - the statement to execute
        arguments - the arguments
        Returns:
        self
      • rxQuerySingleWithParams

        public io.reactivex.Maybe<JsonArray> rxQuerySingleWithParams​(String sql,
                                                                     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.
        Specified by:
        rxQuerySingleWithParams in interface SQLOperations
        Overrides:
        rxQuerySingleWithParams in class SQLClient
        Parameters:
        sql - the statement to execute
        arguments - the arguments
        Returns:
        self
      • create

        public static JDBCClient create​(Vertx vertx,
                                        JsonObject config)
        Create a JDBC client which maintains its own data source.
        Parameters:
        vertx - the Vert.x instance
        config - the configuration
        Returns:
        the client
      • createShared

        public static JDBCClient createShared​(Vertx vertx,
                                              JsonObject config,
                                              String dataSourceName)
        Create a JDBC client which shares its data source with any other JDBC clients created with the same data source name
        Parameters:
        vertx - the Vert.x instance
        config - the configuration
        dataSourceName - the data source name
        Returns:
        the client