Example usage for io.vertx.sqlclient PreparedQuery execute

List of usage examples for io.vertx.sqlclient PreparedQuery execute

Introduction

In this page you can find the example usage for io.vertx.sqlclient PreparedQuery execute.

Prototype

@Fluent
PreparedQuery execute(Tuple args, Handler<AsyncResult<RowSet<Row>>> handler);

Source Link

Document

Create a cursor with the provided arguments .

Usage

From source file:examples.SqlClientExamples.java

License:Apache License

public void usingConnections02(SqlConnection connection) {
    connection.prepare("SELECT * FROM users WHERE first_name LIKE $1", ar1 -> {
        if (ar1.succeeded()) {
            PreparedQuery pq = ar1.result();
            pq.execute(Tuple.of("julien"), ar2 -> {
                if (ar2.succeeded()) {
                    // All rows
                    RowSet<Row> rows = ar2.result();
                }/*from  w  ww.j a va 2s .  co  m*/
            });
        }
    });
}

From source file:examples.SqlClientExamples.java

License:Apache License

public void usingConnections02(SqlConnection connection) {
    connection.prepare("SELECT * FROM users WHERE first_name LIKE ?", ar1 -> {
        if (ar1.succeeded()) {
            PreparedQuery pq = ar1.result();
            pq.execute(Tuple.of("julien"), ar2 -> {
                if (ar2.succeeded()) {
                    // All rows
                    RowSet<Row> rows = ar2.result();
                }/*from  ww w .  j ava 2 s.c  o m*/
            });
        }
    });
}