Package io.vertx.reactivex.db2client
Class DB2Pool
- java.lang.Object
-
- io.vertx.reactivex.sqlclient.SqlClient
-
- io.vertx.reactivex.sqlclient.Pool
-
- io.vertx.reactivex.db2client.DB2Pool
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<DB2Pool>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SqlClient
client(DB2ConnectOptions database, PoolOptions options)
Create a pooled client to the DB2database
configured with the givenoptions
.static SqlClient
client(Vertx vertx, DB2ConnectOptions database, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.static SqlClient
client(Vertx vertx, String connectionUri)
Likeclient(java.lang.String)
with default options.static SqlClient
client(Vertx vertx, String connectionUri, PoolOptions options)
static SqlClient
client(Vertx vertx, List<DB2ConnectOptions> databases, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.static SqlClient
client(String connectionUri)
Likeclient(java.lang.String)
with default options.static SqlClient
client(String connectionUri, PoolOptions options)
static SqlClient
client(List<DB2ConnectOptions> databases, PoolOptions options)
Create a client backed by a connection pool to the DB2databases
with round-robin selection.DB2Pool
connectHandler(Handler<SqlConnection> handler)
Set an handler called when the pool has established a connection to the database.DB2Pool
connectionProvider(io.reactivex.functions.Function<Context,io.reactivex.Single<SqlConnection>> provider)
Replace the default pool connection provider, the newprovider
returns a future connection for a given .DB2Pool
connectionProvider(Function<Context,Future<SqlConnection>> provider)
Replace the default pool connection provider, the newprovider
returns a future connection for a given .boolean
equals(Object o)
DB2Pool
getDelegate()
int
hashCode()
static DB2Pool
newInstance(DB2Pool arg)
static DB2Pool
pool(DB2ConnectOptions database, PoolOptions options)
Create a connection pool to the DB2database
configured with the givenoptions
.static DB2Pool
pool(Vertx vertx, DB2ConnectOptions database, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.static DB2Pool
pool(Vertx vertx, String connectionUri)
Likepool(java.lang.String)
with default options.static DB2Pool
pool(Vertx vertx, String connectionUri, PoolOptions options)
static DB2Pool
pool(Vertx vertx, Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions)
Likepool(java.lang.String)
with a specific instance.static DB2Pool
pool(Vertx vertx, List<DB2ConnectOptions> databases, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.static DB2Pool
pool(String connectionUri)
Likepool(java.lang.String)
with default options.static DB2Pool
pool(String connectionUri, PoolOptions options)
static DB2Pool
pool(Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions)
Create a connection pool to the DB2databases
.static DB2Pool
pool(List<DB2ConnectOptions> databases, PoolOptions options)
Create a connection pool to the DB2databases
with round-robin selection.String
toString()
-
Methods inherited from class io.vertx.reactivex.sqlclient.Pool
close, close, getConnection, getConnection, newInstance, pool, pool, pool, preparedQuery, query, rxClose, rxGetConnection, rxWithConnection, rxWithConnection, rxWithTransaction, rxWithTransaction, rxWithTransaction, rxWithTransaction, size, withConnection, withConnection, withConnection, withConnection, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction
-
Methods inherited from class io.vertx.reactivex.sqlclient.SqlClient
newInstance, preparedQuery
-
-
-
-
Method Detail
-
getDelegate
public DB2Pool getDelegate()
- Overrides:
getDelegate
in classPool
-
pool
public static DB2Pool pool(String connectionUri)
Likepool(java.lang.String)
with default options.- Parameters:
connectionUri
-- Returns:
-
pool
public static DB2Pool pool(String connectionUri, PoolOptions options)
- Parameters:
connectionUri
-options
-- Returns:
-
pool
public static DB2Pool pool(Vertx vertx, String connectionUri)
Likepool(java.lang.String)
with default options.- Parameters:
vertx
-connectionUri
-- Returns:
-
pool
public static DB2Pool pool(Vertx vertx, String connectionUri, PoolOptions options)
- Parameters:
vertx
-connectionUri
-options
-- Returns:
-
pool
public static DB2Pool pool(DB2ConnectOptions database, PoolOptions options)
Create a connection pool to the DB2database
configured with the givenoptions
.- Parameters:
database
- the options for the connectionoptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static DB2Pool pool(Vertx vertx, DB2ConnectOptions database, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.- Parameters:
vertx
-database
-options
-- Returns:
-
pool
public static DB2Pool pool(List<DB2ConnectOptions> databases, PoolOptions options)
Create a connection pool to the DB2databases
with round-robin selection. Round-robin is applied when a new connection is created by the pool.- Parameters:
databases
- the list of serversoptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static DB2Pool pool(Vertx vertx, List<DB2ConnectOptions> databases, PoolOptions options)
Likepool(java.lang.String)
with a specific instance.- Parameters:
vertx
-databases
-options
-- Returns:
-
client
public static SqlClient client(String connectionUri)
Likeclient(java.lang.String)
with default options.- Parameters:
connectionUri
-- Returns:
-
client
public static SqlClient client(String connectionUri, PoolOptions options)
- Parameters:
connectionUri
-options
-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri)
Likeclient(java.lang.String)
with default options.- Parameters:
vertx
-connectionUri
-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri, PoolOptions options)
- Parameters:
vertx
-connectionUri
-options
-- Returns:
-
client
public static SqlClient client(DB2ConnectOptions database, PoolOptions options)
Create a pooled client to the DB2database
configured with the givenoptions
.- Parameters:
database
- the options for the connectionoptions
- the options for creating the pool- Returns:
- the connection pool
-
client
public static SqlClient client(Vertx vertx, DB2ConnectOptions database, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.- Parameters:
vertx
-database
-options
-- Returns:
-
client
public static SqlClient client(List<DB2ConnectOptions> databases, PoolOptions options)
Create a client backed by a connection pool to the DB2databases
with round-robin selection. Round-robin is applied when a new connection is created by the pool.- Parameters:
databases
- the list of serversoptions
- the options for creating the pool- Returns:
- the pooled client
-
client
public static SqlClient client(Vertx vertx, List<DB2ConnectOptions> databases, PoolOptions options)
Likeclient(java.lang.String)
with a specific instance.- Parameters:
vertx
-databases
-options
-- Returns:
-
connectHandler
public DB2Pool connectHandler(Handler<SqlConnection> handler)
Description copied from class:Pool
Set an handler called when the pool has established a connection to the database.This handler allows interactions with the database before the connection is added to the pool.
When the handler has finished, it must call
SqlClient.close(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
to release the connection to the pool.- Overrides:
connectHandler
in classPool
- Parameters:
handler
- the handler- Returns:
- a reference to this, so the API can be used fluently
-
connectionProvider
public DB2Pool connectionProvider(Function<Context,Future<SqlConnection>> provider)
Description copied from class:Pool
Replace the default pool connection provider, the newprovider
returns a future connection for a given .A
ConnectionFactory
can be used as connection provider.- Overrides:
connectionProvider
in classPool
- Parameters:
provider
- the new connection provider- Returns:
- a reference to this, so the API can be used fluently
-
connectionProvider
public DB2Pool connectionProvider(io.reactivex.functions.Function<Context,io.reactivex.Single<SqlConnection>> provider)
Description copied from class:Pool
Replace the default pool connection provider, the newprovider
returns a future connection for a given .A
ConnectionFactory
can be used as connection provider.- Overrides:
connectionProvider
in classPool
- Parameters:
provider
- the new connection provider- Returns:
- a reference to this, so the API can be used fluently
-
pool
public static DB2Pool pool(Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions)
Create a connection pool to the DB2databases
. The supplier is called to provide the options when a new connection is created by the pool.- Parameters:
databases
- the databases supplierpoolOptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static DB2Pool pool(Vertx vertx, Supplier<Future<DB2ConnectOptions>> databases, PoolOptions poolOptions)
Likepool(java.lang.String)
with a specific instance.- Parameters:
vertx
-databases
-poolOptions
-- Returns:
-
-