Package io.vertx.db2client.spi
Class DB2Driver
- java.lang.Object
-
- io.vertx.db2client.spi.DB2Driver
-
- All Implemented Interfaces:
Driver<DB2ConnectOptions>
public class DB2Driver extends Object implements Driver<DB2ConnectOptions>
-
-
Constructor Summary
Constructors Constructor Description DB2Driver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsOptions(SqlConnectOptions options)ConnectionFactory<DB2ConnectOptions>createConnectionFactory(Vertx vertx, NetClientOptions transportOptions)Create a connection factory to the givendatabase.DB2ConnectOptionsdowncast(SqlConnectOptions connectOptions)Downcast the connect options to the specific driver options.PoolnewPool(Vertx vertx, Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions, NetClientOptions transportOptions, Handler<SqlConnection> connectHandler, io.vertx.core.internal.CloseFuture closeFuture)Create a connection pool to the database configured with the givenconnectOptionsandpoolOptions.DB2ConnectOptionsparseConnectionUri(String uri)io.vertx.sqlclient.internal.SqlConnectionInternalwrapConnection(io.vertx.core.internal.ContextInternal context, ConnectionFactory<DB2ConnectOptions> factory, io.vertx.sqlclient.internal.Connection conn)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertx.sqlclient.spi.Driver
appendQueryPlaceholder, createPool
-
-
-
-
Field Detail
-
INSTANCE
public static final DB2Driver INSTANCE
-
-
Method Detail
-
downcast
public DB2ConnectOptions downcast(SqlConnectOptions connectOptions)
Description copied from interface:DriverDowncast the connect options to the specific driver options.- Specified by:
downcastin interfaceDriver<DB2ConnectOptions>- Parameters:
connectOptions- the options to downcast- Returns:
- the downcasted options
-
newPool
public Pool newPool(Vertx vertx, Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions, NetClientOptions transportOptions, Handler<SqlConnection> connectHandler, io.vertx.core.internal.CloseFuture closeFuture)
Description copied from interface:DriverCreate a connection pool to the database configured with the givenconnectOptionsandpoolOptions.This method is not meant to be used directly by users, instead they should use
Driver.createPool(Vertx, Supplier, PoolOptions, NetClientOptions, Handler).- Specified by:
newPoolin interfaceDriver<DB2ConnectOptions>- Parameters:
vertx- the Vertx instance to be used with the connection pooldatabases- the list of databasespoolOptions- the options for creating the pooltransportOptions- the options to configure the TCP clientconnectHandler- the connect handlercloseFuture- the close future- Returns:
- the connection pool
-
parseConnectionUri
public DB2ConnectOptions parseConnectionUri(String uri)
- Specified by:
parseConnectionUriin interfaceDriver<DB2ConnectOptions>- Returns:
trueif the driver accepts theconnectOptions,falseotherwise
-
acceptsOptions
public boolean acceptsOptions(SqlConnectOptions options)
- Specified by:
acceptsOptionsin interfaceDriver<DB2ConnectOptions>- Returns:
- true if the driver accepts the
connectOptions, false otherwise
-
createConnectionFactory
public ConnectionFactory<DB2ConnectOptions> createConnectionFactory(Vertx vertx, NetClientOptions transportOptions)
Description copied from interface:DriverCreate a connection factory to the givendatabase.- Specified by:
createConnectionFactoryin interfaceDriver<DB2ConnectOptions>- Parameters:
vertx- the Vertx instancetransportOptions- 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<DB2ConnectOptions> factory, io.vertx.sqlclient.internal.Connection conn)- Specified by:
wrapConnectionin interfaceDriver<DB2ConnectOptions>
-
-