Class JDBCClient
- java.lang.Object
-
- io.vertx.mutiny.ext.sql.SQLClient
-
- io.vertx.mutiny.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 theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<JDBCClient>__TYPE_ARGstatic StringDEFAULT_DS_NAMEThe name of the default data sourcestatic StringDEFAULT_PROVIDER_CLASSThe default data source provider is C3P0
-
Constructor Summary
Constructors Constructor Description JDBCClient(io.vertx.ext.jdbc.JDBCClient delegate)JDBCClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JDBCClientcreate(Vertx vertx, io.vertx.core.json.JsonObject config)static JDBCClientcreateShared(Vertx vertx, io.vertx.core.json.JsonObject config)static JDBCClientcreateShared(Vertx vertx, io.vertx.core.json.JsonObject config, String dataSourceName)booleanequals(Object o)io.vertx.ext.jdbc.JDBCClientgetDelegate()inthashCode()static JDBCClientnewInstance(io.vertx.ext.jdbc.JDBCClient arg)io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>querySingle(String sql)Execute a one shot SQL statement that returns a single SQL row.io.vertx.core.json.JsonArrayquerySingleAndAwait(String sql)Blocking variant ofSQLOperations.querySingle(String).SQLOperationsquerySingleAndForget(String sql)Variant ofSQLOperations.querySingle(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>querySingleWithParams(String sql, io.vertx.core.json.JsonArray arguments)Execute a one shot SQL statement with arguments that returns a single SQL row.io.vertx.core.json.JsonArrayquerySingleWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray arguments)Blocking variant ofSQLOperations.querySingleWithParams(String,JsonArray).SQLOperationsquerySingleWithParamsAndForget(String sql, io.vertx.core.json.JsonArray arguments)Variant ofSQLOperations.querySingleWithParams(String,JsonArray)that ignores the result of the operation.StringtoString()-
Methods inherited from class io.vertx.mutiny.ext.sql.SQLClient
call, callAndAwait, callAndForget, callWithParams, callWithParamsAndAwait, callWithParamsAndForget, close, closeAndAwait, closeAndForget, getConnection, getConnectionAndAwait, getConnectionAndForget, newInstance, query, queryAndAwait, queryAndForget, queryStream, queryStreamAndAwait, queryStreamAndForget, queryStreamWithParams, queryStreamWithParamsAndAwait, queryStreamWithParamsAndForget, queryWithParams, queryWithParamsAndAwait, queryWithParamsAndForget, update, updateAndAwait, updateAndForget, updateWithParams, updateWithParamsAndAwait, updateWithParamsAndForget
-
-
-
-
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(io.vertx.ext.jdbc.JDBCClient delegate)
-
JDBCClient
public JDBCClient(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.jdbc.JDBCClient getDelegate()
- Specified by:
getDelegatein interfaceSQLOperations- Overrides:
getDelegatein classSQLClient
-
querySingle
public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
querySinglein interfaceSQLOperations- Overrides:
querySinglein classSQLClient- Parameters:
sql- the statement to execute- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
querySingleAndAwait
public io.vertx.core.json.JsonArray querySingleAndAwait(String sql)
Blocking variant ofSQLOperations.querySingle(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
querySingleAndAwaitin interfaceSQLOperations- Overrides:
querySingleAndAwaitin classSQLClient- Parameters:
sql- the statement to execute- Returns:
- the JsonArray instance produced by the operation.
-
querySingleAndForget
public SQLOperations querySingleAndForget(String sql)
Variant ofSQLOperations.querySingle(String)that ignores the result of the operation.This method subscribes on the result of
SQLOperations.querySingle(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromSQLOperations.querySingle(String)but you don't need to compose it with other operations.- Specified by:
querySingleAndForgetin interfaceSQLOperations- Overrides:
querySingleAndForgetin classSQLClient- Parameters:
sql- the statement to execute- Returns:
- the instance of SQLOperations to chain method calls.
-
querySingleWithParams
public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> querySingleWithParams(String sql, io.vertx.core.json.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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
querySingleWithParamsin interfaceSQLOperations- Overrides:
querySingleWithParamsin classSQLClient- Parameters:
sql- the statement to executearguments- the arguments- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
querySingleWithParamsAndAwait
public io.vertx.core.json.JsonArray querySingleWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray arguments)
Blocking variant ofSQLOperations.querySingleWithParams(String,JsonArray).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
querySingleWithParamsAndAwaitin interfaceSQLOperations- Overrides:
querySingleWithParamsAndAwaitin classSQLClient- Parameters:
sql- the statement to executearguments- the arguments- Returns:
- the JsonArray instance produced by the operation.
-
querySingleWithParamsAndForget
public SQLOperations querySingleWithParamsAndForget(String sql, io.vertx.core.json.JsonArray arguments)
Variant ofSQLOperations.querySingleWithParams(String,JsonArray)that ignores the result of the operation.This method subscribes on the result of
SQLOperations.querySingleWithParams(String,JsonArray), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromSQLOperations.querySingleWithParams(String,JsonArray)but you don't need to compose it with other operations.- Specified by:
querySingleWithParamsAndForgetin interfaceSQLOperations- Overrides:
querySingleWithParamsAndForgetin classSQLClient- Parameters:
sql- the statement to executearguments- the arguments- Returns:
- the instance of SQLOperations to chain method calls.
-
create
public static JDBCClient create(Vertx vertx, io.vertx.core.json.JsonObject config)
- Parameters:
vertx- the Vert.x instanceconfig- the configuration- Returns:
- the client
-
createShared
public static JDBCClient createShared(Vertx vertx, io.vertx.core.json.JsonObject config, String dataSourceName)
- Parameters:
vertx- the Vert.x instanceconfig- the configurationdataSourceName- the data source name- Returns:
- the client
-
createShared
public static JDBCClient createShared(Vertx vertx, io.vertx.core.json.JsonObject config)
- Parameters:
vertx- the Vert.x instanceconfig- the configuration- Returns:
- the client
-
newInstance
public static JDBCClient newInstance(io.vertx.ext.jdbc.JDBCClient arg)
-
-