public interface JDBCClient
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DS_NAME
The name of the default data source
|
static String |
DEFAULT_PROVIDER_CLASS
The default data source provider is C3P0
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the client
|
static JDBCClient |
create(Vertx vertx,
DataSource dataSource)
Create a client using a pre-existing data source
|
static JDBCClient |
createNonShared(Vertx vertx,
JsonObject config)
Create a JDBC client which maintains its own data source.
|
static JDBCClient |
createShared(Vertx vertx,
JsonObject config)
Like
createShared(io.vertx.core.Vertx, JsonObject, String) but with the default data source name |
static JDBCClient |
createShared(Vertx vertx,
JsonObject config,
String dataSourceName)
Create a JDBC client which shares its data source with any other JDBC clients created with the same
data source name
|
JDBCClient |
getConnection(Handler<AsyncResult<SQLConnection>> handler)
Returns a connection that can be used to perform SQL operations on.
|
static final String DEFAULT_PROVIDER_CLASS
static final String DEFAULT_DS_NAME
static JDBCClient createNonShared(Vertx vertx, JsonObject config)
vertx
- the Vert.x instanceconfig
- the configurationstatic JDBCClient createShared(Vertx vertx, JsonObject config, String dataSourceName)
vertx
- the Vert.x instanceconfig
- the configurationdataSourceName
- the data source namestatic JDBCClient createShared(Vertx vertx, JsonObject config)
createShared(io.vertx.core.Vertx, JsonObject, String)
but with the default data source namevertx
- the Vert.x instanceconfig
- the configurationstatic JDBCClient create(Vertx vertx, DataSource dataSource)
vertx
- the Vert.x instancedataSource
- the datasourceJDBCClient getConnection(Handler<AsyncResult<SQLConnection>> handler)
handler
- the handler which is called when the JdbcConnection
object is ready for use.void close()
Copyright © 2016. All rights reserved.