public interface MSSQLPool extends Pool
pool
of SQL Server connections
.Modifier and Type | Method and Description |
---|---|
MSSQLPool |
connectHandler(Handler<SqlConnection> handler)
Set an handler called when the pool has established a connection to the database.
|
MSSQLPool |
connectionProvider(java.util.function.Function<Context,Future<SqlConnection>> provider)
Replace the default pool connection provider, the new
provider returns a future connection for a
given Context . |
static MSSQLPool |
pool(List<MSSQLConnectOptions> databases,
PoolOptions options)
Create a connection pool to the SQL Server
databases with round-robin selection. |
static MSSQLPool |
pool(MSSQLConnectOptions database,
PoolOptions options)
Create a connection pool to the SQL server
database configured with the given options . |
static MSSQLPool |
pool(String connectionUri)
Like
pool(String, PoolOptions) with default options. |
static MSSQLPool |
pool(String connectionUri,
PoolOptions options)
|
static MSSQLPool |
pool(Vertx vertx,
List<MSSQLConnectOptions> databases,
PoolOptions options)
Like
pool(List, PoolOptions) with a specific Vertx instance. |
static MSSQLPool |
pool(Vertx vertx,
MSSQLConnectOptions database,
PoolOptions options)
Like
pool(MSSQLConnectOptions, PoolOptions) with a specific Vertx instance. |
static MSSQLPool |
pool(Vertx vertx,
String connectionUri)
Like
pool(Vertx, String, PoolOptions) with default options. |
static MSSQLPool |
pool(Vertx vertx,
String connectionUri,
PoolOptions options)
|
close, getConnection, getConnection, pool, pool, pool, preparedQuery, query, size, withConnection, withConnection, withTransaction, withTransaction
close, preparedQuery
static MSSQLPool pool(String connectionUri)
pool(String, PoolOptions)
with default options.static MSSQLPool pool(String connectionUri, PoolOptions options)
static MSSQLPool pool(Vertx vertx, String connectionUri)
pool(Vertx, String, PoolOptions)
with default options.static MSSQLPool pool(Vertx vertx, String connectionUri, PoolOptions options)
static MSSQLPool pool(MSSQLConnectOptions database, PoolOptions options)
database
configured with the given options
.database
- the options for the connectionoptions
- the options for creating the poolstatic MSSQLPool pool(Vertx vertx, MSSQLConnectOptions database, PoolOptions options)
pool(MSSQLConnectOptions, PoolOptions)
with a specific Vertx
instance.static MSSQLPool pool(List<MSSQLConnectOptions> databases, PoolOptions options)
databases
with round-robin selection.
Round-robin is applied when a new connection is created by the pool.databases
- the list of databasesoptions
- the options for creating the poolstatic MSSQLPool pool(Vertx vertx, List<MSSQLConnectOptions> databases, PoolOptions options)
pool(List, PoolOptions)
with a specific Vertx
instance.MSSQLPool connectHandler(Handler<SqlConnection> handler)
Pool
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()
to release the connection
to the pool.
connectHandler
in interface Pool
handler
- the handlerMSSQLPool connectionProvider(java.util.function.Function<Context,Future<SqlConnection>> provider)
Pool
provider
returns a future connection for a
given Context
.
A ConnectionFactory
can be used as connection provider.
connectionProvider
in interface Pool
provider
- the new connection providerCopyright © 2022 Eclipse. All rights reserved.