use of io.vertx.oracleclient.OracleConnectOptions in project vertx-sql-client by eclipse-vertx.
the class OracleConnectionAutoRetryTest method initialConnector.
@Override
protected void initialConnector(int proxyPort) {
OracleConnectOptions proxyOptions = new OracleConnectOptions(options);
proxyOptions.setPort(proxyPort);
proxyOptions.setHost("localhost");
connectionConnector = ClientConfig.CONNECT.connect(vertx, proxyOptions);
poolConnector = ClientConfig.POOLED.connect(vertx, proxyOptions);
}
use of io.vertx.oracleclient.OracleConnectOptions in project vertx-sql-client by eclipse-vertx.
the class OracleClientExamples method connecting02.
public void connecting02(Vertx vertx) {
// Connect options
OracleConnectOptions connectOptions = new OracleConnectOptions().setPort(1521).setHost("the-host").setDatabase("the-db").setUser("user").setPassword("secret");
// Pool options
PoolOptions poolOptions = new PoolOptions().setMaxSize(5);
// Create the pooled client
OraclePool client = OraclePool.pool(vertx, connectOptions, poolOptions);
}
use of io.vertx.oracleclient.OracleConnectOptions in project vertx-sql-client by eclipse-vertx.
the class OracleClientExamples method configureFromDataObject.
public void configureFromDataObject(Vertx vertx) {
// Data object
OracleConnectOptions connectOptions = new OracleConnectOptions().setPort(1521).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
OraclePool pool = OraclePool.pool(vertx, connectOptions, poolOptions);
pool.getConnection(ar -> {
// Handling your connection
});
}
use of io.vertx.oracleclient.OracleConnectOptions in project vertx-sql-client by eclipse-vertx.
the class OraclePoolTest method testRunStandalone.
@Test
public void testRunStandalone(TestContext ctx) {
Async async = ctx.async();
OraclePool pool = createPool(new OracleConnectOptions(options), new PoolOptions());
pool.query("SELECT id, randomnumber FROM WORLD").execute(ctx.asyncAssertSuccess(v -> {
async.complete();
}));
async.await(4000);
}
use of io.vertx.oracleclient.OracleConnectOptions in project vertx-sql-client by eclipse-vertx.
the class OracleClientExamples method gettingStarted.
public void gettingStarted() {
// Connect options
OracleConnectOptions connectOptions = new OracleConnectOptions().setPort(1521).setHost("the-host").setDatabase("the-db").setUser("user").setPassword("secret");
// Pool options
PoolOptions poolOptions = new PoolOptions().setMaxSize(5);
// Create the client pool
OraclePool client = OraclePool.pool(connectOptions, poolOptions);
// A simple query
client.query("SELECT * FROM users WHERE id='julien'").execute(ar -> {
if (ar.succeeded()) {
RowSet<Row> result = ar.result();
System.out.println("Got " + result.size() + " rows ");
} else {
System.out.println("Failure: " + ar.cause().getMessage());
}
// Now close the pool
client.close();
});
}
Aggregations