Package io.vertx.mssqlclient.spi
Class MSSQLDriver
- java.lang.Object
-
- io.vertx.mssqlclient.spi.MSSQLDriver
-
- All Implemented Interfaces:
Driver<MSSQLConnectOptions>
public class MSSQLDriver extends Object implements Driver<MSSQLConnectOptions>
-
-
Field Summary
Fields Modifier and Type Field Description static MSSQLDriverINSTANCE
-
Constructor Summary
Constructors Constructor Description MSSQLDriver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsOptions(SqlConnectOptions options)intappendQueryPlaceholder(StringBuilder queryBuilder, int index, int current)Append a parameter placeholder in thequery.ConnectionFactory<MSSQLConnectOptions>createConnectionFactory(Vertx vertx, NetClientOptions transportOptions)Create a connection factory to the givendatabase.MSSQLConnectOptionsdowncast(SqlConnectOptions connectOptions)Downcast the connect options to the specific driver options.PoolnewPool(Vertx vertx, Supplier<Future<MSSQLConnectOptions>> databases, PoolOptions options, NetClientOptions transportOptions, Handler<SqlConnection> connectHandler, io.vertx.core.internal.CloseFuture closeFuture)Create a connection pool to the database configured with the givenconnectOptionsandpoolOptions.MSSQLConnectOptionsparseConnectionUri(String uri)io.vertx.sqlclient.internal.SqlConnectionInternalwrapConnection(io.vertx.core.internal.ContextInternal context, ConnectionFactory<MSSQLConnectOptions> factory, io.vertx.sqlclient.internal.Connection conn)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertx.sqlclient.spi.Driver
createPool
-
-
-
-
Field Detail
-
INSTANCE
public static final MSSQLDriver INSTANCE
-
-
Method Detail
-
downcast
public MSSQLConnectOptions downcast(SqlConnectOptions connectOptions)
Description copied from interface:DriverDowncast the connect options to the specific driver options.- Specified by:
downcastin interfaceDriver<MSSQLConnectOptions>- Parameters:
connectOptions- the options to downcast- Returns:
- the downcasted options
-
newPool
public Pool newPool(Vertx vertx, Supplier<Future<MSSQLConnectOptions>> databases, PoolOptions options, NetClientOptions transportOptions, Handler<SqlConnection> connectHandler, io.vertx.core.internal.CloseFuture closeFuture)
Description copied from interface:DriverCreate a connection pool to the database configured with the givenconnectOptionsandpoolOptions.This method is not meant to be used directly by users, instead they should use
Driver.createPool(Vertx, Supplier, PoolOptions, NetClientOptions, Handler).- Specified by:
newPoolin interfaceDriver<MSSQLConnectOptions>- Parameters:
vertx- the Vertx instance to be used with the connection pooldatabases- the list of databasesoptions- the options for creating the pooltransportOptions- the options to configure the TCP clientconnectHandler- the connect handlercloseFuture- the close future- Returns:
- the connection pool
-
createConnectionFactory
public ConnectionFactory<MSSQLConnectOptions> createConnectionFactory(Vertx vertx, NetClientOptions transportOptions)
Description copied from interface:DriverCreate a connection factory to the givendatabase.- Specified by:
createConnectionFactoryin interfaceDriver<MSSQLConnectOptions>- Parameters:
vertx- the Vertx instancetransportOptions- the options to configure the TCP client- Returns:
- the connection factory
-
parseConnectionUri
public MSSQLConnectOptions parseConnectionUri(String uri)
- Specified by:
parseConnectionUriin interfaceDriver<MSSQLConnectOptions>- Returns:
trueif the driver accepts theconnectOptions,falseotherwise
-
acceptsOptions
public boolean acceptsOptions(SqlConnectOptions options)
- Specified by:
acceptsOptionsin interfaceDriver<MSSQLConnectOptions>- Returns:
- true if the driver accepts the
connectOptions, false otherwise
-
appendQueryPlaceholder
public int appendQueryPlaceholder(StringBuilder queryBuilder, int index, int current)
Description copied from interface:DriverAppend a parameter placeholder in thequery.The index starts at
0.- When
index == currentindicates it is a new parameter and therefore the same * value should be returned. - When
index < currentindicates the builder wants to reuse a parameter. The implementation can either return the same value to indicate the parameter can be reused or return the next index to use (which is shall be thecurrentvalue
- Specified by:
appendQueryPlaceholderin interfaceDriver<MSSQLConnectOptions>- Parameters:
queryBuilder- the builder to append toindex- the parameter placeholder index- Returns:
- the index at which the parameter placeholder could be added
- When
-
wrapConnection
public io.vertx.sqlclient.internal.SqlConnectionInternal wrapConnection(io.vertx.core.internal.ContextInternal context, ConnectionFactory<MSSQLConnectOptions> factory, io.vertx.sqlclient.internal.Connection conn)- Specified by:
wrapConnectionin interfaceDriver<MSSQLConnectOptions>
-
-