Example usage for io.vertx.pgclient PgPool pool

List of usage examples for io.vertx.pgclient PgPool pool

Introduction

In this page you can find the example usage for io.vertx.pgclient PgPool pool.

Prototype

static PgPool pool(String connectionUri) 

Source Link

Document

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

Usage

From source file:examples.PgClientExamples.java

License:Apache License

public void configureFromUri(Vertx vertx) {

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

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

    // Create the connection from the connection URI
    PgConnection.connect(vertx, connectionUri, res -> {
        // Handling your connection
    });//from w  w w  .j ava2s.co  m
}