public class SQLConnection 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<SQLConnection> |
__TYPE_ARG |
Constructor and Description |
---|
SQLConnection(Object delegate) |
SQLConnection(SQLConnection delegate) |
Modifier and Type | Method and Description |
---|---|
SQLConnection |
batch(List<String> sqlStatements)
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
|
SQLConnection |
batch(List<String> sqlStatements,
Handler<AsyncResult<List<Integer>>> handler)
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
|
SQLConnection |
batchCallableWithParams(String sqlStatement,
List<JsonArray> inArgs,
List<JsonArray> outArgs)
Batch a callable statement with all entries from the args list.
|
SQLConnection |
batchCallableWithParams(String sqlStatement,
List<JsonArray> inArgs,
List<JsonArray> outArgs,
Handler<AsyncResult<List<Integer>>> handler)
Batch a callable statement with all entries from the args list.
|
SQLConnection |
batchWithParams(String sqlStatement,
List<JsonArray> args)
Batch a prepared statement with all entries from the args list.
|
SQLConnection |
batchWithParams(String sqlStatement,
List<JsonArray> args,
Handler<AsyncResult<List<Integer>>> handler)
Batch a prepared statement with all entries from the args list.
|
SQLConnection |
call(String sql)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
SQLConnection |
call(String sql,
Handler<AsyncResult<ResultSet>> resultHandler)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
SQLConnection |
callWithParams(String sql,
JsonArray params,
JsonArray outputs)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
SQLConnection |
callWithParams(String sql,
JsonArray params,
JsonArray outputs,
Handler<AsyncResult<ResultSet>> resultHandler)
Calls the given SQL
PROCEDURE which returns the result from the procedure. |
void |
close()
Closes the connection.
|
void |
close(Handler<AsyncResult<Void>> handler)
Closes the connection.
|
SQLConnection |
commit()
Commits all changes made since the previous commit/rollback.
|
SQLConnection |
commit(Handler<AsyncResult<Void>> handler)
Commits all changes made since the previous commit/rollback.
|
boolean |
equals(Object o) |
SQLConnection |
execute(String sql)
Executes the given SQL statement
|
SQLConnection |
execute(String sql,
Handler<AsyncResult<Void>> resultHandler)
Executes the given SQL statement
|
SQLConnection |
getDelegate() |
SQLConnection |
getTransactionIsolation()
Attempts to return the transaction isolation level for this Connection object to the one given.
|
SQLConnection |
getTransactionIsolation(Handler<AsyncResult<TransactionIsolation>> handler)
Attempts to return the transaction isolation level for this Connection object to the one given.
|
int |
hashCode() |
static SQLConnection |
newInstance(SQLConnection arg) |
SQLConnection |
query(String sql)
Executes the given SQL
SELECT statement which returns the results of the query. |
SQLConnection |
query(String sql,
Handler<AsyncResult<ResultSet>> resultHandler)
Executes the given SQL
SELECT statement which returns the results of the query. |
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.
|
SQLConnection |
queryStream(String sql)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
SQLConnection |
queryStream(String sql,
Handler<AsyncResult<SQLRowStream>> handler)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
SQLConnection |
queryStreamWithParams(String sql,
JsonArray params)
Executes the given SQL
SELECT statement which returns the results of the query as a read stream. |
SQLConnection |
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. |
SQLConnection |
queryWithParams(String sql,
JsonArray params)
Executes the given SQL
SELECT prepared statement which returns the results of the query. |
SQLConnection |
queryWithParams(String sql,
JsonArray params,
Handler<AsyncResult<ResultSet>> resultHandler)
Executes the given SQL
SELECT prepared statement which returns the results of the query. |
SQLConnection |
rollback()
Rolls back all changes made since the previous commit/rollback.
|
SQLConnection |
rollback(Handler<AsyncResult<Void>> handler)
Rolls back all changes made since the previous commit/rollback.
|
Single<List<Integer>> |
rxBatch(List<String> sqlStatements)
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.
|
Single<List<Integer>> |
rxBatchCallableWithParams(String sqlStatement,
List<JsonArray> inArgs,
List<JsonArray> outArgs)
Batch a callable statement with all entries from the args list.
|
Single<List<Integer>> |
rxBatchWithParams(String sqlStatement,
List<JsonArray> args)
Batch a prepared statement with all entries from the args list.
|
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. |
Single<Void> |
rxClose()
Closes the connection.
|
Single<Void> |
rxCommit()
Commits all changes made since the previous commit/rollback.
|
Single<Void> |
rxExecute(String sql)
Executes the given SQL statement
|
Single<TransactionIsolation> |
rxGetTransactionIsolation()
Attempts to return the transaction isolation level for this Connection object to the one given.
|
Single<ResultSet> |
rxQuery(String sql)
Executes the given SQL
SELECT statement which returns the results of the query. |
Single<JsonArray> |
rxQuerySingle(String sql)
Execute a one shot SQL statement that returns a single SQL row.
|
Single<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 params)
Executes the given SQL
SELECT prepared statement which returns the results of the query. |
Single<Void> |
rxRollback()
Rolls back all changes made since the previous commit/rollback.
|
Single<Void> |
rxSetAutoCommit(boolean autoCommit)
Sets the auto commit flag for this connection.
|
Single<Void> |
rxSetTransactionIsolation(TransactionIsolation isolation)
Attempts to change the transaction isolation level for this Connection object to the one given.
|
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 |
SQLConnection |
setAutoCommit(boolean autoCommit)
Sets the auto commit flag for this connection.
|
SQLConnection |
setAutoCommit(boolean autoCommit,
Handler<AsyncResult<Void>> resultHandler)
Sets the auto commit flag for this connection.
|
SQLConnection |
setOptions(SQLOptions options)
Sets the desired options to be applied to the current connection when statements are executed.
|
SQLConnection |
setQueryTimeout(int timeoutInSeconds)
Deprecated.
|
SQLConnection |
setTransactionIsolation(TransactionIsolation isolation)
Attempts to change the transaction isolation level for this Connection object to the one given.
|
SQLConnection |
setTransactionIsolation(TransactionIsolation isolation,
Handler<AsyncResult<Void>> handler)
Attempts to change the transaction isolation level for this Connection object to the one given.
|
String |
toString() |
SQLConnection |
update(String sql)
Executes the given SQL statement which may be an
INSERT , UPDATE , or DELETE
statement. |
SQLConnection |
update(String sql,
Handler<AsyncResult<UpdateResult>> resultHandler)
Executes the given SQL statement which may be an
INSERT , UPDATE , or DELETE
statement. |
SQLConnection |
updateWithParams(String sql,
JsonArray params)
Executes the given prepared statement which may be an
INSERT , UPDATE , or DELETE
statement with the given parameters |
SQLConnection |
updateWithParams(String sql,
JsonArray params,
Handler<AsyncResult<UpdateResult>> resultHandler)
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<SQLConnection> __TYPE_ARG
public SQLConnection(SQLConnection delegate)
public SQLConnection(Object delegate)
public SQLConnection 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 SQLOperations querySingle(String sql)
querySingle
in interface SQLOperations
sql
- the statement to executepublic Single<JsonArray> rxQuerySingle(String sql)
rxQuerySingle
in interface SQLOperations
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 SQLOperations querySingleWithParams(String sql, JsonArray arguments)
querySingleWithParams
in interface SQLOperations
sql
- the statement to executearguments
- the argumentspublic Single<JsonArray> rxQuerySingleWithParams(String sql, JsonArray arguments)
rxQuerySingleWithParams
in interface SQLOperations
sql
- the statement to executearguments
- the argumentspublic SQLConnection setOptions(SQLOptions options)
options
- the options to modify the unwrapped connection.public SQLConnection setAutoCommit(boolean autoCommit, Handler<AsyncResult<Void>> resultHandler)
autoCommit
- the autoCommit flag, true by default.resultHandler
- the handler which is called once this operation completes.public SQLConnection setAutoCommit(boolean autoCommit)
autoCommit
- the autoCommit flag, true by default.public Single<Void> rxSetAutoCommit(boolean autoCommit)
autoCommit
- the autoCommit flag, true by default.public SQLConnection execute(String sql, Handler<AsyncResult<Void>> resultHandler)
sql
- the SQL to execute. For example CREATE TABLE IF EXISTS table ...
resultHandler
- the handler which is called once this operation completes.public SQLConnection execute(String sql)
sql
- the SQL to execute. For example CREATE TABLE IF EXISTS table ...
public Single<Void> rxExecute(String sql)
sql
- the SQL to execute. For example CREATE TABLE IF EXISTS table ...
public SQLConnection query(String sql, Handler<AsyncResult<ResultSet>> resultHandler)
SELECT
statement which returns the results of the query.query
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
.public SQLConnection query(String sql)
SELECT
statement which returns the results of the query.query
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.public Single<ResultSet> rxQuery(String sql)
SELECT
statement which returns the results of the query.rxQuery
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.public SQLConnection 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 SQLConnection queryStream(String sql)
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 ...
.public Single<SQLRowStream> rxQueryStream(String sql)
SELECT
statement which returns the results of the query as a read stream.rxQueryStream
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.public SQLConnection queryWithParams(String sql, JsonArray params, Handler<AsyncResult<ResultSet>> resultHandler)
SELECT
prepared statement which returns the results of the query.queryWithParams
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
.public SQLConnection queryWithParams(String sql, JsonArray params)
SELECT
prepared statement which returns the results of the query.queryWithParams
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.public Single<ResultSet> rxQueryWithParams(String sql, JsonArray params)
SELECT
prepared statement which returns the results of the query.rxQueryWithParams
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.public SQLConnection 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 SQLConnection queryStreamWithParams(String sql, JsonArray params)
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.public Single<SQLRowStream> rxQueryStreamWithParams(String sql, JsonArray params)
SELECT
statement which returns the results of the query as a read stream.rxQueryStreamWithParams
in interface SQLOperations
sql
- the SQL to execute. For example SELECT * FROM table ...
.params
- these are the parameters to fill the statement.public SQLConnection update(String sql, Handler<AsyncResult<UpdateResult>> resultHandler)
INSERT
, UPDATE
, or DELETE
statement.update
in interface SQLOperations
sql
- the SQL to execute. For example INSERT INTO table ...
resultHandler
- the handler which is called once the operation completes.public SQLConnection update(String sql)
INSERT
, UPDATE
, or DELETE
statement.update
in interface SQLOperations
sql
- the SQL to execute. For example INSERT INTO table ...
public Single<UpdateResult> rxUpdate(String sql)
INSERT
, UPDATE
, or DELETE
statement.rxUpdate
in interface SQLOperations
sql
- the SQL to execute. For example INSERT INTO table ...
public SQLConnection updateWithParams(String sql, JsonArray params, Handler<AsyncResult<UpdateResult>> resultHandler)
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.resultHandler
- the handler which is called once the operation completes.public SQLConnection updateWithParams(String sql, JsonArray params)
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.public Single<UpdateResult> rxUpdateWithParams(String sql, JsonArray params)
INSERT
, UPDATE
, or DELETE
statement with the given parametersrxUpdateWithParams
in interface SQLOperations
sql
- the SQL to execute. For example INSERT INTO table ...
params
- these are the parameters to fill the statement.public SQLConnection call(String sql, Handler<AsyncResult<ResultSet>> resultHandler)
PROCEDURE
which returns the result from the procedure.call
in interface SQLOperations
sql
- the SQL to execute. For example {call getEmpName}
.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
.public SQLConnection call(String sql)
PROCEDURE
which returns the result from the procedure.call
in interface SQLOperations
sql
- the SQL to execute. For example {call getEmpName}
.public Single<ResultSet> rxCall(String sql)
PROCEDURE
which returns the result from the procedure.rxCall
in interface SQLOperations
sql
- the SQL to execute. For example {call getEmpName}
.public SQLConnection callWithParams(String sql, JsonArray params, JsonArray outputs, Handler<AsyncResult<ResultSet>> resultHandler)
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.resultHandler
- the handler which is called once the operation completes. It will return a ResultSet
.public SQLConnection callWithParams(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"]
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.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"]
rxCallWithParams
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.public void close(Handler<AsyncResult<Void>> handler)
handler
- the handler called when this operation completes.public Single<Void> rxClose()
public void close()
public SQLConnection commit(Handler<AsyncResult<Void>> handler)
handler
- the handler called when this operation completes.public SQLConnection commit()
public Single<Void> rxCommit()
public SQLConnection rollback(Handler<AsyncResult<Void>> handler)
handler
- the handler called when this operation completes.public SQLConnection rollback()
public Single<Void> rxRollback()
@Deprecated public SQLConnection setQueryTimeout(int timeoutInSeconds)
timeoutInSeconds
- the max amount of seconds the query can take to execute.public SQLConnection batch(List<String> sqlStatements, Handler<AsyncResult<List<Integer>>> handler)
sqlStatements
- sql statementhandler
- the result handlerpublic SQLConnection batch(List<String> sqlStatements)
sqlStatements
- sql statementpublic Single<List<Integer>> rxBatch(List<String> sqlStatements)
sqlStatements
- sql statementpublic SQLConnection batchWithParams(String sqlStatement, List<JsonArray> args, Handler<AsyncResult<List<Integer>>> handler)
sqlStatement
- sql statementargs
- the prepared statement argumentshandler
- the result handlerpublic SQLConnection batchWithParams(String sqlStatement, List<JsonArray> args)
sqlStatement
- sql statementargs
- the prepared statement argumentspublic Single<List<Integer>> rxBatchWithParams(String sqlStatement, List<JsonArray> args)
sqlStatement
- sql statementargs
- the prepared statement argumentspublic SQLConnection batchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs, Handler<AsyncResult<List<Integer>>> handler)
sqlStatement
- sql statementinArgs
- the callable statement input argumentsoutArgs
- the callable statement output argumentshandler
- the result handlerpublic SQLConnection batchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs)
sqlStatement
- sql statementinArgs
- the callable statement input argumentsoutArgs
- the callable statement output argumentspublic Single<List<Integer>> rxBatchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs)
sqlStatement
- sql statementinArgs
- the callable statement input argumentsoutArgs
- the callable statement output argumentspublic SQLConnection setTransactionIsolation(TransactionIsolation isolation, Handler<AsyncResult<Void>> handler)
isolation
- the level of isolationhandler
- the handler called when this operation completes.public SQLConnection setTransactionIsolation(TransactionIsolation isolation)
isolation
- the level of isolationpublic Single<Void> rxSetTransactionIsolation(TransactionIsolation isolation)
isolation
- the level of isolationpublic SQLConnection getTransactionIsolation(Handler<AsyncResult<TransactionIsolation>> handler)
handler
- the handler called when this operation completes.public SQLConnection getTransactionIsolation()
public Single<TransactionIsolation> rxGetTransactionIsolation()
public static SQLConnection newInstance(SQLConnection arg)
Copyright © 2021 Eclipse. All rights reserved.