use of io.vertx.mssqlclient.MSSQLConnectOptions in project vertx-sql-client by eclipse-vertx.
the class MSSQLDataTypeTestBase method setup.
@Before
public void setup() {
vertx = Vertx.vertx();
options = new MSSQLConnectOptions(MSSQLTestBase.options);
}
use of io.vertx.mssqlclient.MSSQLConnectOptions in project vertx-sql-client by eclipse-vertx.
the class MSSQLConnectOptionsProviderTest method testValidUri4.
@Test
public void testValidUri4() {
connectionUri = "sqlserver://myhost/mydb";
actualConfiguration = MSSQLConnectOptions.fromUri(connectionUri);
expectedConfiguration = new MSSQLConnectOptions().setHost("myhost").setDatabase("mydb");
assertEquals(expectedConfiguration, actualConfiguration);
}
use of io.vertx.mssqlclient.MSSQLConnectOptions in project vertx-sql-client by eclipse-vertx.
the class MSSQLConnectOptionsProviderTest method testValidUri3.
@Test
public void testValidUri3() {
connectionUri = "sqlserver://myhost:3306";
actualConfiguration = MSSQLConnectOptions.fromUri(connectionUri);
expectedConfiguration = new MSSQLConnectOptions().setHost("myhost").setPort(3306);
assertEquals(expectedConfiguration, actualConfiguration);
}
use of io.vertx.mssqlclient.MSSQLConnectOptions in project vertx-sql-client by eclipse-vertx.
the class MSSQLConnectOptionsProviderTest method testValidUri1.
@Test
public void testValidUri1() {
connectionUri = "sqlserver://localhost";
actualConfiguration = MSSQLConnectOptions.fromUri(connectionUri);
expectedConfiguration = new MSSQLConnectOptions();
assertEquals(expectedConfiguration, actualConfiguration);
}
use of io.vertx.mssqlclient.MSSQLConnectOptions in project vertx-sql-client by eclipse-vertx.
the class MSSQLClientExamples method configureFromDataObject.
public void configureFromDataObject(Vertx vertx) {
// Data object
MSSQLConnectOptions connectOptions = new MSSQLConnectOptions().setPort(1433).setHost("the-host").setDatabase("the-db").setUser("user").setPassword("secret");
// Pool Options
PoolOptions poolOptions = new PoolOptions().setMaxSize(5);
// Create the pool from the data object
MSSQLPool pool = MSSQLPool.pool(vertx, connectOptions, poolOptions);
pool.getConnection(ar -> {
// Handling your connection
});
}
Aggregations