Example usage for io.vertx.sqlclient PoolOptions PoolOptions

List of usage examples for io.vertx.sqlclient PoolOptions PoolOptions

Introduction

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

Prototype

public PoolOptions() 

Source Link

Usage

From source file:examples.PgClientExamples.java

License:Apache License

public void connecting06(Vertx vertx) {

    // Connect Options
    // Socket file name will be /var/run/postgresql/.s.PGSQL.5432
    PgConnectOptions connectOptions = new PgConnectOptions().setHost("/var/run/postgresql").setPort(5432)
            .setDatabase("the-db");

    // Pool options
    PoolOptions poolOptions = new PoolOptions().setMaxSize(5);

    // Create the pooled client
    PgPool client = PgPool.pool(connectOptions, poolOptions);

    // Create the pooled client with a vertx instance
    // Make sure the vertx instance has enabled native transports
    PgPool client2 = PgPool.pool(vertx, connectOptions, poolOptions);
}