public interface Pool extends SqlClient
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.
|
void |
getConnection(Handler<AsyncResult<SqlConnection>> handler)
Get a connection from the pool.
|
PreparedQuery<RowSet<Row>> |
preparedQuery(String sql)
Create a prepared query, one of the
PreparedQuery.execute(io.vertx.sqlclient.Tuple, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>) or PreparedQuery.executeBatch(java.util.List<io.vertx.sqlclient.Tuple>, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
methods must be called to execute the query. |
Query<RowSet<Row>> |
query(String sql)
Create a query, the
Query.execute(io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>) method must be called to execute the query. |
void getConnection(Handler<AsyncResult<SqlConnection>> handler)
handler
- the handler that will get the connection resultQuery<RowSet<Row>> query(String sql)
Query.execute(io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
method must be called to execute the query.
A connection is borrowed from the connection pool when the query is executed and then immediately returned
to the pool after it completes.PreparedQuery<RowSet<Row>> preparedQuery(String sql)
PreparedQuery.execute(io.vertx.sqlclient.Tuple, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
or PreparedQuery.executeBatch(java.util.List<io.vertx.sqlclient.Tuple>, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
methods must be called to execute the query.
A connection is borrowed from the connection pool when the query is executed and then immediately returned
to the pool after it completes.preparedQuery
in interface SqlClient
void begin(Handler<AsyncResult<Transaction>> handler)
Copyright © 2020 Eclipse. All rights reserved.