/** * Returns a connection that can be used to perform SQL operations on. It's important to remember to close the * connection when you are done, so it is returned to the pool. * @param handler the handler which is called when the <code>JdbcConnection</code> object is ready for use. */ public void getConnection(Handler<AsyncResult<SqlConnection>> handler) { this.delegate.getConnection(new Handler<AsyncResult<io.vertx.ext.sql.SqlConnection>>() { public void handle(AsyncResult<io.vertx.ext.sql.SqlConnection> event) { AsyncResult<SqlConnection> f; if (event.succeeded()) { f = InternalHelper.<SqlConnection>result(new SqlConnection(event.result())); } else { f = InternalHelper.<SqlConnection>failure(event.cause()); } handler.handle(f); } }); }
service.getConnection(res -> { if (res.failed()) { msg.fail(-1, res.cause().getMessage());