Example usage for io.vertx.sqlclient Row getColumnIndex

List of usage examples for io.vertx.sqlclient Row getColumnIndex

Introduction

In this page you can find the example usage for io.vertx.sqlclient Row getColumnIndex.

Prototype

int getColumnIndex(String name);

Source Link

Document

Get a column position for the given column name .

Usage

From source file:examples.MySQLClientExamples.java

public void booleanExample01(SqlClient client) {
    client.query("SELECT graduated FROM students WHERE id = 0", ar -> {
        if (ar.succeeded()) {
            RowSet<Row> rowSet = ar.result();
            for (Row row : rowSet) {
                int pos = row.getColumnIndex("graduated");
                Byte value = row.get(Byte.class, pos);
                Boolean graduated = row.getBoolean("graduated");
            }//from w  ww .j  ava2 s.  c o  m
        } else {
            System.out.println("Failure: " + ar.cause().getMessage());
        }
    });
}