io.vertx.ext.jdbc

## Interface JDBCClient

-     public interface JDBCClient

  An asynchronous client interface for interacting with a JDBC compliant database
  Author:
    Nick Scavelli, Tim Fox

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_DS_NAME` The name of the default data source
    `static String` | `DEFAULT_PROVIDER_CLASS` The default data source provider is C3P0

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the client
    `static JDBCClient` | `create(Vertx vertx, DataSource dataSource)` Create a client using a pre-existing data source
    `static JDBCClient` | `createNonShared(Vertx vertx, JsonObject config)` Create a JDBC client which maintains its own data source.
    `static JDBCClient` | `createShared(Vertx vertx, JsonObject config)` Like `createShared(io.vertx.core.Vertx, JsonObject, String)` but with the default data source name
    `static JDBCClient` | `createShared(Vertx vertx, JsonObject config, String dataSourceName)` Create a JDBC client which shares its data source with any other JDBC clients created with the same data source name
    `JDBCClient` | `getConnection(Handler<AsyncResult<SQLConnection>> handler)` Returns a connection that can be used to perform SQL operations on.

- - ### Field Detail

    - #### DEFAULT_PROVIDER_CLASS

          static final String DEFAULT_PROVIDER_CLASS

      The default data source provider is C3P0
      See Also:
        Constant Field Values

    - #### DEFAULT_DS_NAME

          static final String DEFAULT_DS_NAME

      The name of the default data source
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### createNonShared

          static JDBCClient createNonShared(Vertx vertx,
                                            JsonObject config)

      Create a JDBC client which maintains its own data source.
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration
      Returns:
        the client

    - #### createShared

          static JDBCClient createShared(Vertx vertx,
                                         JsonObject config,
                                         String dataSourceName)

      Create a JDBC client which shares its data source with any other JDBC clients created with the same data source name
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration
        `dataSourceName` - the data source name
      Returns:
        the client

    - #### createShared

          static JDBCClient createShared(Vertx vertx,
                                         JsonObject config)

      Like `createShared(io.vertx.core.Vertx, JsonObject, String)` but with the default data source name
      Parameters:
        `vertx` - the Vert.x instance
        `config` - the configuration
      Returns:
        the client

    - #### create

          static JDBCClient create(Vertx vertx,
                                   DataSource dataSource)

      Create a client using a pre-existing data source
      Parameters:
        `vertx` - the Vert.x instance
        `dataSource` - the datasource
      Returns:
        the client

    - #### getConnection

          JDBCClient getConnection(Handler<AsyncResult<SQLConnection>> handler)

      Returns a connection that can be used to perform SQL operations on. It's important to remember to close the connection when you are done, so it is returned to the pool.
      Parameters:
        `handler` - the handler which is called when the `JdbcConnection` object is ready for use.

    - #### close

          void close()

      Close the client

Copyright © 2017. All rights reserved.