Class DriverBase<O extends SqlConnectOptions>

java.lang.Object
io.vertx.sqlclient.spi.DriverBase<O>
Type Parameters:
O -
All Implemented Interfaces:
Driver<O>
Direct Known Subclasses:
DB2Driver, MSSQLDriver, MySQLDriver, OracleDriver, PgDriver

public abstract class DriverBase<O extends SqlConnectOptions> extends Object implements Driver<O>
A generic driver.
  • Constructor Details

  • Method Details

    • createConnectionFactory

      public abstract ConnectionFactory<O> createConnectionFactory(Vertx vertx, NetClientOptions transportOptions)
      Create a connection factory to the given database.
      Parameters:
      vertx - the Vertx instance
      transportOptions - the options to configure the TCP client
      Returns:
      the connection factory
    • wrapConnection

      public io.vertx.sqlclient.internal.SqlConnectionInternal wrapConnection(io.vertx.core.internal.ContextInternal context, ConnectionFactory<O> factory, Connection connection)
      Wrap a given connection into a SqlConnectionInternal. The default implementation wraps with a generic SqlConnectionBase.
      Parameters:
      context - the connection context
      factory - the connection factory
      connection - the connection to wrap
      Returns:
      the wrapped connection
    • newPool

      public Pool newPool(Vertx vertx, Supplier<Future<O>> databases, PoolOptions options, NetClientOptions transportOptions, Handler<SqlConnection> connectHandler, io.vertx.core.internal.CloseFuture closeFuture)
      Description copied from interface: Driver
      Create a connection pool to the database configured with the given connectOptions and poolOptions.

      This method is not meant to be used directly by users, instead they should use Driver.createPool(Vertx, Supplier, PoolOptions, NetClientOptions, Handler).

      Specified by:
      newPool in interface Driver<O extends SqlConnectOptions>
      Parameters:
      vertx - the Vertx instance to be used with the connection pool
      databases - the list of databases
      options - the options for creating the pool
      transportOptions - the options to configure the TCP client
      connectHandler - the connect handler
      closeFuture - the close future
      Returns:
      the connection pool
    • newPool

      protected Pool newPool(io.vertx.core.internal.VertxInternal vertx, Handler<SqlConnection> connectHandler, Supplier<Future<O>> databases, PoolOptions poolOptions, NetClientOptions transportOptions, io.vertx.core.internal.CloseFuture closeFuture)