Example usage for io.vertx.mysqlclient MySQLPool pool

List of usage examples for io.vertx.mysqlclient MySQLPool pool

Introduction

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

Prototype

static MySQLPool pool(String connectionUri) 

Source Link

Document

Like #pool(String,PoolOptions) with a default poolOptions .

Usage

From source file:examples.MySQLClientExamples.java

public void configureFromUri(Vertx vertx) {

    // Connection URI
    String connectionUri = "mysql://dbuser:secretpassword@database.server.com:3211/mydb";

    // Create the pool from the connection URI
    MySQLPool pool = MySQLPool.pool(connectionUri);

    // Create the connection from the connection URI
    MySQLConnection.connect(vertx, connectionUri, res -> {
        // Handling your connection
    });// w w w  .  j  av a2s. c om
}