Example usage for io.vertx.pgclient PgConnection connect

List of usage examples for io.vertx.pgclient PgConnection connect

Introduction

In this page you can find the example usage for io.vertx.pgclient PgConnection connect.

Prototype

static void connect(Vertx vertx, Handler<AsyncResult<PgConnection>> handler) 

Source Link

Document

Like #connect(Vertx,PgConnectOptions,Handler) with options build from the environment variables.

Usage

From source file:examples.PgClientExamples.java

License:Apache License

public void configureFromEnv(Vertx vertx) {

    // Create the pool from the environment variables
    PgPool pool = PgPool.pool();/*from   ww  w  . j  ava2s  .c  o  m*/

    // Create the connection from the environment variables
    PgConnection.connect(vertx, res -> {
        // Handling your connection
    });
}