Package io.vertx.mssqlclient

## Interface MSSQLConnection

- All Superinterfaces:
    `SqlClient`, `SqlConnection`

      public interface MSSQLConnection
      extends SqlConnection

  A connection to Microsoft SQL Server.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static MSSQLConnection` | `cast​(SqlConnection sqlConnection)` | Cast a `SqlConnection` to `MSSQLConnection`.
    `MSSQLConnection` | `closeHandler​(Handler<Void> handler)` | Set an handler called when the connection is closed.
    `static Future<MSSQLConnection>` | `connect​(Vertx vertx, MSSQLConnectOptions connectOptions)` | Create a connection to SQL Server with the given `connectOptions`.
    `static Future<MSSQLConnection>` | `connect​(Vertx vertx, String connectionUri)` | Like `connect(Vertx, MSSQLConnectOptions)` with options built from `connectionUri`.
    `MSSQLConnection` | `exceptionHandler​(Handler<Throwable> handler)` | Set an handler called with connection errors.
    `MSSQLConnection` | `infoHandler​(Handler<MSSQLInfo> handler)` | Set a handler called when the connection receives an informational message from the server.

    - ### Methods inherited from interface io.vertx.sqlclient.SqlClient

      `close, preparedQuery, preparedQuery, query`

    - ### Methods inherited from interface io.vertx.sqlclient.SqlConnection

      `begin, databaseMetadata, isSSL, prepare, prepare, transaction`

- - ### Method Detail

    - #### connect

          static Future<MSSQLConnection> connect​(Vertx vertx,
                                                 MSSQLConnectOptions connectOptions)

      Create a connection to SQL Server with the given `connectOptions`.
      Parameters:
        `vertx` - the vertx instance
        `connectOptions` - the options for the connection
      Returns:
        a future notified with the connection or the failure

    - #### connect

          static Future<MSSQLConnection> connect​(Vertx vertx,
                                                 String connectionUri)

      Like `connect(Vertx, MSSQLConnectOptions)` with options built from `connectionUri`.

    - #### exceptionHandler

          MSSQLConnection exceptionHandler​(Handler<Throwable> handler)

      Set an handler called with connection errors.
      Specified by:
        `exceptionHandler` in interface `SqlConnection`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### closeHandler

          MSSQLConnection closeHandler​(Handler<Void> handler)

      Set an handler called when the connection is closed.
      Specified by:
        `closeHandler` in interface `SqlConnection`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### infoHandler

          MSSQLConnection infoHandler​(Handler<MSSQLInfo> handler)

      Set a handler called when the connection receives an informational message from the server.
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### cast

          static MSSQLConnection cast​(SqlConnection sqlConnection)

      Cast a `SqlConnection` to `MSSQLConnection`. This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.
      Parameters:
        `sqlConnection` - the connection to cast
      Returns:
        a `instance`