Example usage for io.vertx.mysqlclient MySQLAuthOptions MySQLAuthOptions

List of usage examples for io.vertx.mysqlclient MySQLAuthOptions MySQLAuthOptions

Introduction

In this page you can find the example usage for io.vertx.mysqlclient MySQLAuthOptions MySQLAuthOptions.

Prototype

public MySQLAuthOptions() 

Source Link

Usage

From source file:examples.MySQLClientExamples.java

public void changeUserExample(MySQLConnection connection) {
    MySQLAuthOptions authenticationOptions = new MySQLAuthOptions().setUser("newuser")
            .setPassword("newpassword").setDatabase("newdatabase");
    connection.changeUser(authenticationOptions, ar -> {
        if (ar.succeeded()) {
            System.out.println("User of current connection has been changed.");
        } else {/*  w  w w  .ja v a  2  s. c  om*/
            System.out.println("Failure: " + ar.cause().getMessage());
        }
    });
}