Search in sources :

Example 1 with MSSQLConnectOptions

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);
}
Also used : MSSQLConnectOptions(io.vertx.mssqlclient.MSSQLConnectOptions) Before(org.junit.Before)

Example 2 with MSSQLConnectOptions

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);
}
Also used : MSSQLConnectOptions(io.vertx.mssqlclient.MSSQLConnectOptions) Test(org.junit.Test)

Example 3 with MSSQLConnectOptions

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);
}
Also used : MSSQLConnectOptions(io.vertx.mssqlclient.MSSQLConnectOptions) Test(org.junit.Test)

Example 4 with MSSQLConnectOptions

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);
}
Also used : MSSQLConnectOptions(io.vertx.mssqlclient.MSSQLConnectOptions) Test(org.junit.Test)

Example 5 with MSSQLConnectOptions

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
    });
}
Also used : MSSQLConnectOptions(io.vertx.mssqlclient.MSSQLConnectOptions) MSSQLPool(io.vertx.mssqlclient.MSSQLPool)

Aggregations

MSSQLConnectOptions (io.vertx.mssqlclient.MSSQLConnectOptions)14 MSSQLPool (io.vertx.mssqlclient.MSSQLPool)6 Test (org.junit.Test)4 Vertx (io.vertx.core.Vertx)2 PoolOptions (io.vertx.sqlclient.PoolOptions)2 SqlConnectOptions (io.vertx.sqlclient.SqlConnectOptions)2 Collectors (java.util.stream.Collectors)2 CredentialsProvider (io.quarkus.credentials.CredentialsProvider)1 CloseFuture (io.vertx.core.impl.CloseFuture)1 ContextInternal (io.vertx.core.impl.ContextInternal)1 VertxInternal (io.vertx.core.impl.VertxInternal)1 JsonObject (io.vertx.core.json.JsonObject)1 PemTrustOptions (io.vertx.core.net.PemTrustOptions)1 ClientMetrics (io.vertx.core.spi.metrics.ClientMetrics)1 VertxMetrics (io.vertx.core.spi.metrics.VertxMetrics)1 Source (io.vertx.docgen.Source)1 MSSQLConnection (io.vertx.mssqlclient.MSSQLConnection)1 MSSQLConnectionFactory (io.vertx.mssqlclient.impl.MSSQLConnectionFactory)1 MSSQLConnectionImpl (io.vertx.mssqlclient.impl.MSSQLConnectionImpl)1 MSSQLConnectionUriParser (io.vertx.mssqlclient.impl.MSSQLConnectionUriParser)1