public class SQLClient extends Object implements SQLOperations
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<SQLClient> |
__TYPE_ARG |
Constructor and Description |
---|
SQLClient(Object delegate) |
SQLClient(SQLClient delegate) |
Modifier and Type | Method and Description |
---|---|
SQLClient |
call(String sql,
Handler<AsyncResult<ResultSet>> handler)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
SQLClient |
callWithParams(String sql,
JsonArray params,
JsonArray outputs,
Handler<AsyncResult<ResultSet>> handler)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
void |
close()
Close the client
|
void |
close(Handler<AsyncResult<Void>> handler)
Close the client and release all resources.
|
boolean |
equals(Object o) |
SQLClient |
getConnection(Handler<AsyncResult<SQLConnection>> handler)
Returns a connection that can be used to perform SQL operations on.
|
SQLClient |
getDelegate() |
int |
hashCode() |
static SQLClient |
newInstance(SQLClient arg) |
SQLClient |
query(String sql,
Handler<AsyncResult<ResultSet>> handler)
Execute a single SQL statement, this method acquires a connection from the the pool and executes the SQL
statement and returns it back after the execution.
|
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,
Handler<AsyncResult<JsonArray>> handler)
Execute a one shot SQL statement with arguments that returns a single SQL row.
|
SQLClient |
queryStream(String sql,
Handler<AsyncResult<SQLRowStream>> handler)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
SQLClient |
queryStreamWithParams(String sql,
JsonArray params,
Handler<AsyncResult<SQLRowStream>> handler)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
SQLClient |
queryWithParams(String sql,
JsonArray arguments,
Handler<AsyncResult<ResultSet>> handler)
Execute a single SQL prepared statement, this method acquires a connection from the the pool and executes the SQL
prepared statement and returns it back after the execution.
|
Single<ResultSet> |
rxCall(String sql)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
Single<ResultSet> |
rxCallWithParams(String sql,
JsonArray params,
JsonArray outputs)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
Completable |
rxClose()
Close the client and release all resources.
|
Single<SQLConnection> |
rxGetConnection()
Returns a connection that can be used to perform SQL operations on.
|
Single<ResultSet> |
rxQuery(String sql)
Execute a single SQL statement, this method acquires a connection from the the pool and executes the SQL
statement and returns it back after the execution.
|
Maybe<JsonArray> |
rxQuerySingle(String sql)
Execute a one shot SQL statement that returns a single SQL row.
|
Maybe<JsonArray> |
rxQuerySingleWithParams(String sql,
JsonArray arguments)
Execute a one shot SQL statement with arguments that returns a single SQL row.
|
Single<SQLRowStream> |
rxQueryStream(String sql)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
Single<SQLRowStream> |
rxQueryStreamWithParams(String sql,
JsonArray params)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
Single<ResultSet> |
rxQueryWithParams(String sql,
JsonArray arguments)
Execute a single SQL prepared statement, this method acquires a connection from the the pool and executes the SQL
prepared statement and returns it back after the execution.
|
Single<UpdateResult> |
rxUpdate(String sql)
Executes the given SQL statement which may be an
INSERT , UPDATE , or DELETE
statement. |
Single<UpdateResult> |
rxUpdateWithParams(String sql,
JsonArray params)
Executes the given prepared statement which may be an
INSERT , UPDATE , or DELETE
statement with the given parameters |
String |
toString() |
SQLClient |
update(String sql,
Handler<AsyncResult<UpdateResult>> handler)
Executes the given SQL statement which may be an
INSERT , UPDATE , or DELETE
statement. |
SQLClient |
updateWithParams(String sql,
JsonArray params,
Handler<AsyncResult<UpdateResult>> handler)
Executes the given prepared statement which may be an
INSERT , UPDATE , or DELETE
statement with the given parameters |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance
public static final io.vertx.lang.rx.TypeArg<SQLClient> __TYPE_ARG
public SQLClient(SQLClient delegate)
public SQLClient(Object delegate)
public SQLClient getDelegate()
getDelegate
in interface SQLOperations
public SQLOperations querySingle(String sql, Handler<AsyncResult<JsonArray>> handler)
querySingle
in interface SQLOperations
sql
- the statement to executehandler
- the result handlerpublic Maybe<JsonArray> rxQuerySingle(String sql)
sql
- the statement to executepublic SQLOperations querySingleWithParams(String sql, JsonArray arguments, Handler<AsyncResult<JsonArray>> handler)
querySingleWithParams
in interface SQLOperations
sql
- the statement to executearguments
- the argumentshandler
- the result handlerpublic Maybe<JsonArray> rxQuerySingleWithParams(String sql, JsonArray arguments)
sql
- the statement to executearguments
- the argumentspublic SQLClient getConnection(Handler<AsyncResult<SQLConnection>> handler)
handler
- the handler which is called when the JdbcConnection
object is ready for use.public Single<SQLConnection> rxGetConnection()
public void close(Handler<AsyncResult<Void>> handler)
handler
- the handler that will be called when close is completepublic Completable rxClose()
public void close()
public SQLClient query(String sql, Handler<AsyncResult<ResultSet>> handler)
query
in interface SQLOperations
sql
- the statement to executehandler
- the result handlerpublic Single<ResultSet> rxQuery(String sql)
sql
- the statement to executepublic SQLClient queryStream(String sql, Handler<AsyncResult<SQLRowStream>> handler)
SELECT
statement which returns the results of the query as a read stream.queryStream
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.handler
- the handler which is called once the operation completes. It will return a SQLRowStream
.public Single<SQLRowStream> rxQueryStream(String sql)
SELECT
statement which returns the results of the query as a read stream.sql
- the SQL to execute. For example SELECT * FROM table ...
.public SQLClient queryStreamWithParams(String sql, JsonArray params, Handler<AsyncResult<SQLRowStream>> handler)
SELECT
statement which returns the results of the query as a read stream.queryStreamWithParams
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.handler
- the handler which is called once the operation completes. It will return a SQLRowStream
.public Single<SQLRowStream> rxQueryStreamWithParams(String sql, JsonArray params)
SELECT
statement which returns the results of the query as a read stream.sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.public SQLClient queryWithParams(String sql, JsonArray arguments, Handler<AsyncResult<ResultSet>> handler)
queryWithParams
in interface SQLOperations
sql
- the statement to executearguments
- the arguments to the statementhandler
- the result handlerpublic Single<ResultSet> rxQueryWithParams(String sql, JsonArray arguments)
sql
- the statement to executearguments
- the arguments to the statementpublic SQLClient update(String sql, Handler<AsyncResult<UpdateResult>> handler)
INSERT
, UPDATE
, or DELETE
statement.update
in interface SQLOperations
sql
- the SQL to execute. For example INSERT INTO table ...
handler
- the handler which is called once the operation completes.public Single<UpdateResult> rxUpdate(String sql)
INSERT
, UPDATE
, or DELETE
statement.sql
- the SQL to execute. For example INSERT INTO table ...
public SQLClient updateWithParams(String sql, JsonArray params, Handler<AsyncResult<UpdateResult>> handler)
INSERT
, UPDATE
, or DELETE
statement with the given parametersupdateWithParams
in interface SQLOperations
sql
- the SQL to execute. For example INSERT INTO table ...
params
- these are the parameters to fill the statement.handler
- the handler which is called once the operation completes.public Single<UpdateResult> rxUpdateWithParams(String sql, JsonArray params)
INSERT
, UPDATE
, or DELETE
statement with the given parameterssql
- the SQL to execute. For example INSERT INTO table ...
params
- these are the parameters to fill the statement.public SQLClient call(String sql, Handler<AsyncResult<ResultSet>> handler)
PROCEDURE
which returns the result from the procedure.call
in interface SQLOperations
sql
- the SQL to execute. For example {call getEmpName}
.handler
- the handler which is called once the operation completes. It will return a ResultSet
.public Single<ResultSet> rxCall(String sql)
PROCEDURE
which returns the result from the procedure.sql
- the SQL to execute. For example {call getEmpName}
.public SQLClient callWithParams(String sql, JsonArray params, JsonArray outputs, Handler<AsyncResult<ResultSet>> handler)
PROCEDURE
which returns the result from the procedure.
The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
params = [VALUE1, VALUE2, null] outputs = [null, null, "VARCHAR"]
callWithParams
in interface SQLOperations
sql
- the SQL to execute. For example {call getEmpName (?, ?)}
.params
- these are the parameters to fill the statement.outputs
- these are the outputs to fill the statement.handler
- the handler which is called once the operation completes. It will return a ResultSet
.public Single<ResultSet> rxCallWithParams(String sql, JsonArray params, JsonArray outputs)
PROCEDURE
which returns the result from the procedure.
The index of params and outputs are important for both arrays, for example when dealing with a prodecure that
takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:
params = [VALUE1, VALUE2, null] outputs = [null, null, "VARCHAR"]
sql
- the SQL to execute. For example {call getEmpName (?, ?)}
.params
- these are the parameters to fill the statement.outputs
- these are the outputs to fill the statement.Copyright © 2023 Eclipse. All rights reserved.