Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<Pool> |
__TYPE_ARG |
Constructor and Description |
---|
Pool(Object delegate) |
Pool(Pool delegate) |
Modifier and Type | Method and Description |
---|---|
void |
begin(Handler<AsyncResult<Transaction>> handler)
Borrow a connection from the pool and begin a transaction, the underlying connection will be returned
to the pool when the transaction ends.
|
void |
close()
Close the pool and release the associated resources.
|
boolean |
equals(Object o) |
void |
getConnection(Handler<AsyncResult<SqlConnection>> handler)
Get a connection from the pool.
|
Pool |
getDelegate() |
int |
hashCode() |
static Pool |
newInstance(Pool arg) |
static Pool |
pool(SqlConnectOptions connectOptions)
Create a connection pool to the database configured with the given
connectOptions and default PoolOptions |
static Pool |
pool(SqlConnectOptions connectOptions,
PoolOptions poolOptions)
Create a connection pool to the database configured with the given
connectOptions and poolOptions . |
static Pool |
pool(Vertx vertx,
SqlConnectOptions connectOptions,
PoolOptions poolOptions)
Create a connection pool to the database configured with the given
connectOptions and poolOptions . |
PreparedQuery<RowSet<Row>> |
preparedQuery(String sql)
A connection is borrowed from the connection pool when the query is executed and then immediately returned
to the pool after it completes.
|
Query<RowSet<Row>> |
query(String sql)
A connection is borrowed from the connection pool when the query is executed and then immediately returned
to the pool after it completes.
|
Single<Transaction> |
rxBegin()
Borrow a connection from the pool and begin a transaction, the underlying connection will be returned
to the pool when the transaction ends.
|
Single<SqlConnection> |
rxGetConnection()
Get a connection from the pool.
|
String |
toString() |
newInstance
public static final io.vertx.lang.rx.TypeArg<Pool> __TYPE_ARG
public Pool getDelegate()
getDelegate
in class SqlClient
public static Pool pool(SqlConnectOptions connectOptions)
connectOptions
and default PoolOptions
connectOptions
- the options used to create the connection pool, such as database hostnamepublic static Pool pool(SqlConnectOptions connectOptions, PoolOptions poolOptions)
connectOptions
and poolOptions
.connectOptions
- the options used to create the connection pool, such as database hostnamepoolOptions
- the options for creating the poolpublic static Pool pool(Vertx vertx, SqlConnectOptions connectOptions, PoolOptions poolOptions)
connectOptions
and poolOptions
.vertx
- the Vertx instance to be used with the connection poolconnectOptions
- the options used to create the connection pool, such as database hostnamepoolOptions
- the options for creating the poolpublic void getConnection(Handler<AsyncResult<SqlConnection>> handler)
handler
- the handler that will get the connection resultpublic Single<SqlConnection> rxGetConnection()
public Query<RowSet<Row>> query(String sql)
public PreparedQuery<RowSet<Row>> preparedQuery(String sql)
preparedQuery
in class SqlClient
sql
- public void begin(Handler<AsyncResult<Transaction>> handler)
handler
- public Single<Transaction> rxBegin()
public void close()
Copyright © 2023 Eclipse. All rights reserved.