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 Default Methods
    Modifier and Type | Method and 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)` Like `connect(Vertx, MSSQLConnectOptions, Handler)` but returns a `Future` of the asynchronous result
    `static void` | `connect(Vertx vertx, MSSQLConnectOptions connectOptions, Handler<AsyncResult<MSSQLConnection>> handler)` Create a connection to SQL Server with the given `connectOptions`.
    `static Future<MSSQLConnection>` | `connect(Vertx vertx, String connectionUri)` Like `connect(Vertx, String, Handler)` but returns a `Future` of the asynchronous result
    `static void` | `connect(Vertx vertx, String connectionUri, Handler<AsyncResult<MSSQLConnection>> handler)` Like `connect(Vertx, MSSQLConnectOptions, Handler)` 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.
    `MSSQLConnection` | `prepare(String s, Handler<AsyncResult<PreparedStatement>> handler)` Create a prepared statement using the given `sql` string.

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

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

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

      `close, preparedQuery, preparedQuery, query`

- - ### Method Detail

    - #### connect

          static void connect(Vertx vertx,
                              MSSQLConnectOptions connectOptions,
                              Handler<AsyncResult<MSSQLConnection>> handler)

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

    - #### connect

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

      Like `connect(Vertx, MSSQLConnectOptions, Handler)` but returns a `Future` of the asynchronous result

    - #### connect

          static void connect(Vertx vertx,
                              String connectionUri,
                              Handler<AsyncResult<MSSQLConnection>> handler)

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

    - #### connect

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

      Like `connect(Vertx, String, Handler)` but returns a `Future` of the asynchronous result

    - #### prepare

          MSSQLConnection prepare(String s,
                                  Handler<AsyncResult<PreparedStatement>> handler)

      Create a prepared statement using the given `sql` string.
      Specified by:
        `prepare` in interface `SqlConnection`
      Parameters:
        `s` - the sql
        `handler` - the handler notified with the prepared query asynchronously

    - #### 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`

Copyright © 2023 Eclipse. All rights reserved.