Package io.vertx.reactivex.ext.jdbc
Class JDBCClient
- java.lang.Object
-
- io.vertx.reactivex.ext.sql.SQLClient
-
- io.vertx.reactivex.ext.jdbc.JDBCClient
-
- All Implemented Interfaces:
SQLOperations
public class JDBCClient extends SQLClient
An asynchronous client interface for interacting with a JDBC compliant database NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<JDBCClient>
__TYPE_ARG
static String
DEFAULT_DS_NAME
The name of the default data sourcestatic String
DEFAULT_PROVIDER_CLASS
The default data source provider is C3P0
-
Constructor Summary
Constructors Constructor Description JDBCClient(JDBCClient delegate)
JDBCClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JDBCClient
create(Vertx vertx, JsonObject config)
Create a JDBC client which maintains its own data source.static JDBCClient
createShared(Vertx vertx, JsonObject config)
LikecreateShared(io.vertx.reactivex.core.Vertx, io.vertx.core.json.JsonObject, java.lang.String)
but with the default data source namestatic 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 nameboolean
equals(Object o)
JDBCClient
getDelegate()
int
hashCode()
static JDBCClient
newInstance(JDBCClient arg)
SQLOperations
querySingle(String sql)
Execute a one shot SQL statement that returns a single SQL row.SQLOperations
querySingle(String sql, Handler<AsyncResult<JsonArray>> handler)
Execute a one shot SQL statement that returns a single SQL row.SQLOperations
querySingleWithParams(String sql, JsonArray arguments)
Execute a one shot SQL statement with arguments that returns a single SQL row.SQLOperations
querySingleWithParams(String sql, JsonArray arguments, Handler<AsyncResult<JsonArray>> handler)
Execute a one shot SQL statement with arguments that returns a single SQL row.io.reactivex.Maybe<JsonArray>
rxQuerySingle(String sql)
Execute a one shot SQL statement that returns a single SQL row.io.reactivex.Maybe<JsonArray>
rxQuerySingleWithParams(String sql, JsonArray arguments)
Execute a one shot SQL statement with arguments that returns a single SQL row.String
toString()
-
Methods inherited from class io.vertx.reactivex.ext.sql.SQLClient
call, call, callWithParams, callWithParams, close, close, getConnection, getConnection, newInstance, query, query, queryStream, queryStream, queryStreamWithParams, queryStreamWithParams, queryWithParams, queryWithParams, rxCall, rxCallWithParams, rxClose, rxGetConnection, rxQuery, rxQueryStream, rxQueryStreamWithParams, rxQueryWithParams, rxUpdate, rxUpdateWithParams, update, update, updateWithParams, updateWithParams
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<JDBCClient> __TYPE_ARG
-
DEFAULT_PROVIDER_CLASS
public static final String DEFAULT_PROVIDER_CLASS
The default data source provider is C3P0- See Also:
- Constant Field Values
-
DEFAULT_DS_NAME
public static final String DEFAULT_DS_NAME
The name of the default data source- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JDBCClient
public JDBCClient(JDBCClient delegate)
-
JDBCClient
public JDBCClient(Object delegate)
-
-
Method Detail
-
getDelegate
public JDBCClient getDelegate()
- Specified by:
getDelegate
in interfaceSQLOperations
- Overrides:
getDelegate
in classSQLClient
-
querySingle
public SQLOperations querySingle(String sql, Handler<AsyncResult<JsonArray>> handler)
Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.- Specified by:
querySingle
in interfaceSQLOperations
- Overrides:
querySingle
in classSQLClient
- Parameters:
sql
- the statement to executehandler
- the result handler- Returns:
- self
-
querySingle
public SQLOperations querySingle(String sql)
Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.- Specified by:
querySingle
in interfaceSQLOperations
- Overrides:
querySingle
in classSQLClient
- Parameters:
sql
- the statement to execute- Returns:
- self
-
rxQuerySingle
public io.reactivex.Maybe<JsonArray> rxQuerySingle(String sql)
Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.- Specified by:
rxQuerySingle
in interfaceSQLOperations
- Overrides:
rxQuerySingle
in classSQLClient
- Parameters:
sql
- the statement to execute- Returns:
- self
-
querySingleWithParams
public SQLOperations querySingleWithParams(String sql, JsonArray arguments, Handler<AsyncResult<JsonArray>> handler)
Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.- Specified by:
querySingleWithParams
in interfaceSQLOperations
- Overrides:
querySingleWithParams
in classSQLClient
- Parameters:
sql
- the statement to executearguments
- the argumentshandler
- the result handler- Returns:
- self
-
querySingleWithParams
public SQLOperations querySingleWithParams(String sql, JsonArray arguments)
Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.- Specified by:
querySingleWithParams
in interfaceSQLOperations
- Overrides:
querySingleWithParams
in classSQLClient
- Parameters:
sql
- the statement to executearguments
- the arguments- Returns:
- self
-
rxQuerySingleWithParams
public io.reactivex.Maybe<JsonArray> rxQuerySingleWithParams(String sql, JsonArray arguments)
Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.- Specified by:
rxQuerySingleWithParams
in interfaceSQLOperations
- Overrides:
rxQuerySingleWithParams
in classSQLClient
- Parameters:
sql
- the statement to executearguments
- the arguments- Returns:
- self
-
create
public static JDBCClient create(Vertx vertx, JsonObject config)
Create a JDBC client which maintains its own data source.- Parameters:
vertx
- the Vert.x instanceconfig
- the configuration- Returns:
- the client
-
createShared
public 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- Parameters:
vertx
- the Vert.x instanceconfig
- the configurationdataSourceName
- the data source name- Returns:
- the client
-
createShared
public static JDBCClient createShared(Vertx vertx, JsonObject config)
LikecreateShared(io.vertx.reactivex.core.Vertx, io.vertx.core.json.JsonObject, java.lang.String)
but with the default data source name- Parameters:
vertx
- the Vert.x instanceconfig
- the configuration- Returns:
- the client
-
newInstance
public static JDBCClient newInstance(JDBCClient arg)
-
-