Package io.vertx.reactivex.ext.sql
Class SQLConnection
- java.lang.Object
-
- io.vertx.reactivex.ext.sql.SQLConnection
-
- All Implemented Interfaces:
SQLOperations
public class SQLConnection extends Object implements SQLOperations
Represents a connection to a SQL 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<SQLConnection>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description SQLConnection(SQLConnection delegate)
SQLConnection(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 SQLPROCEDURE
which returns the result from the procedure.SQLConnection
call(String sql, Handler<AsyncResult<ResultSet>> resultHandler)
Calls the given SQLPROCEDURE
which returns the result from the procedure.SQLConnection
callWithParams(String sql, JsonArray params, JsonArray outputs)
Calls the given SQLPROCEDURE
which returns the result from the procedure.SQLConnection
callWithParams(String sql, JsonArray params, JsonArray outputs, Handler<AsyncResult<ResultSet>> resultHandler)
Calls the given SQLPROCEDURE
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 statementSQLConnection
execute(String sql, Handler<AsyncResult<Void>> resultHandler)
Executes the given SQL statementSQLConnection
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 SQLSELECT
statement which returns the results of the query.SQLConnection
query(String sql, Handler<AsyncResult<ResultSet>> resultHandler)
Executes the given SQLSELECT
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 SQLSELECT
statement which returns the results of the query as a read stream.SQLConnection
queryStream(String sql, Handler<AsyncResult<SQLRowStream>> handler)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.SQLConnection
queryStreamWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
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 SQLSELECT
statement which returns the results of the query as a read stream.SQLConnection
queryWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
prepared statement which returns the results of the query.SQLConnection
queryWithParams(String sql, JsonArray params, Handler<AsyncResult<ResultSet>> resultHandler)
Executes the given SQLSELECT
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.io.reactivex.Single<List<Integer>>
rxBatch(List<String> sqlStatements)
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.io.reactivex.Single<List<Integer>>
rxBatchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs)
Batch a callable statement with all entries from the args list.io.reactivex.Single<List<Integer>>
rxBatchWithParams(String sqlStatement, List<JsonArray> args)
Batch a prepared statement with all entries from the args list.io.reactivex.Single<ResultSet>
rxCall(String sql)
Calls the given SQLPROCEDURE
which returns the result from the procedure.io.reactivex.Single<ResultSet>
rxCallWithParams(String sql, JsonArray params, JsonArray outputs)
Calls the given SQLPROCEDURE
which returns the result from the procedure.io.reactivex.Completable
rxClose()
Closes the connection.io.reactivex.Completable
rxCommit()
Commits all changes made since the previous commit/rollback.io.reactivex.Completable
rxExecute(String sql)
Executes the given SQL statementio.reactivex.Single<TransactionIsolation>
rxGetTransactionIsolation()
Attempts to return the transaction isolation level for this Connection object to the one given.io.reactivex.Single<ResultSet>
rxQuery(String sql)
Executes the given SQLSELECT
statement which returns the results of the query.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.io.reactivex.Single<SQLRowStream>
rxQueryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.io.reactivex.Single<SQLRowStream>
rxQueryStreamWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.io.reactivex.Single<ResultSet>
rxQueryWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
prepared statement which returns the results of the query.io.reactivex.Completable
rxRollback()
Rolls back all changes made since the previous commit/rollback.io.reactivex.Completable
rxSetAutoCommit(boolean autoCommit)
Sets the auto commit flag for this connection.io.reactivex.Completable
rxSetTransactionIsolation(TransactionIsolation isolation)
Attempts to change the transaction isolation level for this Connection object to the one given.io.reactivex.Single<UpdateResult>
rxUpdate(String sql)
Executes the given SQL statement which may be anINSERT
,UPDATE
, orDELETE
statement.io.reactivex.Single<UpdateResult>
rxUpdateWithParams(String sql, JsonArray params)
Executes the given prepared statement which may be anINSERT
,UPDATE
, orDELETE
statement with the given parametersSQLConnection
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 anINSERT
,UPDATE
, orDELETE
statement.SQLConnection
update(String sql, Handler<AsyncResult<UpdateResult>> resultHandler)
Executes the given SQL statement which may be anINSERT
,UPDATE
, orDELETE
statement.SQLConnection
updateWithParams(String sql, JsonArray params)
Executes the given prepared statement which may be anINSERT
,UPDATE
, orDELETE
statement with the given parametersSQLConnection
updateWithParams(String sql, JsonArray params, Handler<AsyncResult<UpdateResult>> resultHandler)
Executes the given prepared statement which may be anINSERT
,UPDATE
, orDELETE
statement with the given parameters
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<SQLConnection> __TYPE_ARG
-
-
Constructor Detail
-
SQLConnection
public SQLConnection(SQLConnection delegate)
-
SQLConnection
public SQLConnection(Object delegate)
-
-
Method Detail
-
getDelegate
public SQLConnection getDelegate()
- Specified by:
getDelegate
in interfaceSQLOperations
-
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
- 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
- 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
- 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
- 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
- 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
- Parameters:
sql
- the statement to executearguments
- the arguments- Returns:
- self
-
setOptions
public SQLConnection setOptions(SQLOptions options)
Sets the desired options to be applied to the current connection when statements are executed. The options are not applied globally but applicable to the current connection. For example changing the transaction isolation level will only affect statements run on this connection and not future or current connections acquired from the connection pool. This method is not async in nature since the apply will only happen at the moment a query is run.- Parameters:
options
- the options to modify the unwrapped connection.- Returns:
-
setAutoCommit
public SQLConnection setAutoCommit(boolean autoCommit, Handler<AsyncResult<Void>> resultHandler)
Sets the auto commit flag for this connection. True by default.- Parameters:
autoCommit
- the autoCommit flag, true by default.resultHandler
- the handler which is called once this operation completes.- Returns:
-
setAutoCommit
public SQLConnection setAutoCommit(boolean autoCommit)
Sets the auto commit flag for this connection. True by default.- Parameters:
autoCommit
- the autoCommit flag, true by default.- Returns:
-
rxSetAutoCommit
public io.reactivex.Completable rxSetAutoCommit(boolean autoCommit)
Sets the auto commit flag for this connection. True by default.- Parameters:
autoCommit
- the autoCommit flag, true by default.- Returns:
-
execute
public SQLConnection execute(String sql, Handler<AsyncResult<Void>> resultHandler)
Executes the given SQL statement- Parameters:
sql
- the SQL to execute. For exampleCREATE TABLE IF EXISTS table ...
resultHandler
- the handler which is called once this operation completes.- Returns:
-
execute
public SQLConnection execute(String sql)
Executes the given SQL statement- Parameters:
sql
- the SQL to execute. For exampleCREATE TABLE IF EXISTS table ...
- Returns:
-
rxExecute
public io.reactivex.Completable rxExecute(String sql)
Executes the given SQL statement- Parameters:
sql
- the SQL to execute. For exampleCREATE TABLE IF EXISTS table ...
- Returns:
-
query
public SQLConnection query(String sql, Handler<AsyncResult<ResultSet>> resultHandler)
Executes the given SQLSELECT
statement which returns the results of the query.- Specified by:
query
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.resultHandler
- the handler which is called once the operation completes. It will return aResultSet
.- Returns:
-
query
public SQLConnection query(String sql)
Executes the given SQLSELECT
statement which returns the results of the query.- Specified by:
query
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.- Returns:
-
rxQuery
public io.reactivex.Single<ResultSet> rxQuery(String sql)
Executes the given SQLSELECT
statement which returns the results of the query.- Specified by:
rxQuery
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.- Returns:
-
queryStream
public SQLConnection queryStream(String sql, Handler<AsyncResult<SQLRowStream>> handler)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Specified by:
queryStream
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.handler
- the handler which is called once the operation completes. It will return aSQLRowStream
.- Returns:
-
queryStream
public SQLConnection queryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Specified by:
queryStream
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.- Returns:
-
rxQueryStream
public io.reactivex.Single<SQLRowStream> rxQueryStream(String sql)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Specified by:
rxQueryStream
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.- Returns:
-
queryWithParams
public SQLConnection queryWithParams(String sql, JsonArray params, Handler<AsyncResult<ResultSet>> resultHandler)
Executes the given SQLSELECT
prepared statement which returns the results of the query.- Specified by:
queryWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.params
- these are the parameters to fill the statement.resultHandler
- the handler which is called once the operation completes. It will return aResultSet
.- Returns:
-
queryWithParams
public SQLConnection queryWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
prepared statement which returns the results of the query.- Specified by:
queryWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.params
- these are the parameters to fill the statement.- Returns:
-
rxQueryWithParams
public io.reactivex.Single<ResultSet> rxQueryWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
prepared statement which returns the results of the query.- Specified by:
rxQueryWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.params
- these are the parameters to fill the statement.- Returns:
-
queryStreamWithParams
public SQLConnection queryStreamWithParams(String sql, JsonArray params, Handler<AsyncResult<SQLRowStream>> handler)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Specified by:
queryStreamWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.params
- these are the parameters to fill the statement.handler
- the handler which is called once the operation completes. It will return aSQLRowStream
.- Returns:
-
queryStreamWithParams
public SQLConnection queryStreamWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Specified by:
queryStreamWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.params
- these are the parameters to fill the statement.- Returns:
-
rxQueryStreamWithParams
public io.reactivex.Single<SQLRowStream> rxQueryStreamWithParams(String sql, JsonArray params)
Executes the given SQLSELECT
statement which returns the results of the query as a read stream.- Specified by:
rxQueryStreamWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleSELECT * FROM table ...
.params
- these are the parameters to fill the statement.- Returns:
-
update
public SQLConnection update(String sql, Handler<AsyncResult<UpdateResult>> resultHandler)
Executes the given SQL statement which may be anINSERT
,UPDATE
, orDELETE
statement.- Specified by:
update
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleINSERT INTO table ...
resultHandler
- the handler which is called once the operation completes.- Returns:
-
update
public SQLConnection update(String sql)
Executes the given SQL statement which may be anINSERT
,UPDATE
, orDELETE
statement.- Specified by:
update
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleINSERT INTO table ...
- Returns:
-
rxUpdate
public io.reactivex.Single<UpdateResult> rxUpdate(String sql)
Executes the given SQL statement which may be anINSERT
,UPDATE
, orDELETE
statement.- Specified by:
rxUpdate
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleINSERT INTO table ...
- Returns:
-
updateWithParams
public SQLConnection updateWithParams(String sql, JsonArray params, Handler<AsyncResult<UpdateResult>> resultHandler)
Executes the given prepared statement which may be anINSERT
,UPDATE
, orDELETE
statement with the given parameters- Specified by:
updateWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleINSERT INTO table ...
params
- these are the parameters to fill the statement.resultHandler
- the handler which is called once the operation completes.- Returns:
-
updateWithParams
public SQLConnection updateWithParams(String sql, JsonArray params)
Executes the given prepared statement which may be anINSERT
,UPDATE
, orDELETE
statement with the given parameters- Specified by:
updateWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleINSERT INTO table ...
params
- these are the parameters to fill the statement.- Returns:
-
rxUpdateWithParams
public io.reactivex.Single<UpdateResult> rxUpdateWithParams(String sql, JsonArray params)
Executes the given prepared statement which may be anINSERT
,UPDATE
, orDELETE
statement with the given parameters- Specified by:
rxUpdateWithParams
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For exampleINSERT INTO table ...
params
- these are the parameters to fill the statement.- Returns:
-
call
public SQLConnection call(String sql, Handler<AsyncResult<ResultSet>> resultHandler)
Calls the given SQLPROCEDURE
which returns the result from the procedure.- Specified by:
call
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For example{call getEmpName}
.resultHandler
- the handler which is called once the operation completes. It will return aResultSet
.- Returns:
-
call
public SQLConnection call(String sql)
Calls the given SQLPROCEDURE
which returns the result from the procedure.- Specified by:
call
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For example{call getEmpName}
.- Returns:
-
rxCall
public io.reactivex.Single<ResultSet> rxCall(String sql)
Calls the given SQLPROCEDURE
which returns the result from the procedure.- Specified by:
rxCall
in interfaceSQLOperations
- Parameters:
sql
- the SQL to execute. For example{call getEmpName}
.- Returns:
-
callWithParams
public SQLConnection callWithParams(String sql, JsonArray params, JsonArray outputs, Handler<AsyncResult<ResultSet>> resultHandler)
Calls the given SQLPROCEDURE
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"]
- Specified by:
callWithParams
in interfaceSQLOperations
- Parameters:
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 aResultSet
.- Returns:
-
callWithParams
public SQLConnection callWithParams(String sql, JsonArray params, JsonArray outputs)
Calls the given SQLPROCEDURE
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"]
- Specified by:
callWithParams
in interfaceSQLOperations
- Parameters:
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.- Returns:
-
rxCallWithParams
public io.reactivex.Single<ResultSet> rxCallWithParams(String sql, JsonArray params, JsonArray outputs)
Calls the given SQLPROCEDURE
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"]
- Specified by:
rxCallWithParams
in interfaceSQLOperations
- Parameters:
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.- Returns:
-
close
public void close(Handler<AsyncResult<Void>> handler)
Closes the connection. Important to always close the connection when you are done so it's returned to the pool.- Parameters:
handler
- the handler called when this operation completes.
-
rxClose
public io.reactivex.Completable rxClose()
Closes the connection. Important to always close the connection when you are done so it's returned to the pool.- Returns:
-
close
public void close()
Closes the connection. Important to always close the connection when you are done so it's returned to the pool.
-
commit
public SQLConnection commit(Handler<AsyncResult<Void>> handler)
Commits all changes made since the previous commit/rollback.- Parameters:
handler
- the handler called when this operation completes.- Returns:
-
commit
public SQLConnection commit()
Commits all changes made since the previous commit/rollback.- Returns:
-
rxCommit
public io.reactivex.Completable rxCommit()
Commits all changes made since the previous commit/rollback.- Returns:
-
rollback
public SQLConnection rollback(Handler<AsyncResult<Void>> handler)
Rolls back all changes made since the previous commit/rollback.- Parameters:
handler
- the handler called when this operation completes.- Returns:
-
rollback
public SQLConnection rollback()
Rolls back all changes made since the previous commit/rollback.- Returns:
-
rxRollback
public io.reactivex.Completable rxRollback()
Rolls back all changes made since the previous commit/rollback.- Returns:
-
setQueryTimeout
@Deprecated public SQLConnection setQueryTimeout(int timeoutInSeconds)
Deprecated.Sets a connection wide query timeout. It can be over written at any time and becomes active on the next query call.- Parameters:
timeoutInSeconds
- the max amount of seconds the query can take to execute.- Returns:
-
batch
public 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.- Parameters:
sqlStatements
- sql statementhandler
- the result handler- Returns:
-
batch
public SQLConnection batch(List<String> sqlStatements)
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.- Parameters:
sqlStatements
- sql statement- Returns:
-
rxBatch
public io.reactivex.Single<List<Integer>> rxBatch(List<String> sqlStatements)
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.- Parameters:
sqlStatements
- sql statement- Returns:
-
batchWithParams
public SQLConnection batchWithParams(String sqlStatement, List<JsonArray> args, Handler<AsyncResult<List<Integer>>> handler)
Batch a prepared statement with all entries from the args list. Each entry is a batch. The operation completes with the execution of the batch where the async result contains a array of Integers.- Parameters:
sqlStatement
- sql statementargs
- the prepared statement argumentshandler
- the result handler- Returns:
-
batchWithParams
public SQLConnection batchWithParams(String sqlStatement, List<JsonArray> args)
Batch a prepared statement with all entries from the args list. Each entry is a batch. The operation completes with the execution of the batch where the async result contains a array of Integers.- Parameters:
sqlStatement
- sql statementargs
- the prepared statement arguments- Returns:
-
rxBatchWithParams
public io.reactivex.Single<List<Integer>> rxBatchWithParams(String sqlStatement, List<JsonArray> args)
Batch a prepared statement with all entries from the args list. Each entry is a batch. The operation completes with the execution of the batch where the async result contains a array of Integers.- Parameters:
sqlStatement
- sql statementargs
- the prepared statement arguments- Returns:
-
batchCallableWithParams
public 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. Each entry is a batch. The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers.- Parameters:
sqlStatement
- sql statementinArgs
- the callable statement input argumentsoutArgs
- the callable statement output argumentshandler
- the result handler- Returns:
-
batchCallableWithParams
public SQLConnection batchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs)
Batch a callable statement with all entries from the args list. Each entry is a batch. The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers.- Parameters:
sqlStatement
- sql statementinArgs
- the callable statement input argumentsoutArgs
- the callable statement output arguments- Returns:
-
rxBatchCallableWithParams
public io.reactivex.Single<List<Integer>> rxBatchCallableWithParams(String sqlStatement, List<JsonArray> inArgs, List<JsonArray> outArgs)
Batch a callable statement with all entries from the args list. Each entry is a batch. The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers.- Parameters:
sqlStatement
- sql statementinArgs
- the callable statement input argumentsoutArgs
- the callable statement output arguments- Returns:
-
setTransactionIsolation
public SQLConnection setTransactionIsolation(TransactionIsolation isolation, Handler<AsyncResult<Void>> handler)
Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.- Parameters:
isolation
- the level of isolationhandler
- the handler called when this operation completes.- Returns:
-
setTransactionIsolation
public SQLConnection setTransactionIsolation(TransactionIsolation isolation)
Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.- Parameters:
isolation
- the level of isolation- Returns:
-
rxSetTransactionIsolation
public io.reactivex.Completable rxSetTransactionIsolation(TransactionIsolation isolation)
Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.- Parameters:
isolation
- the level of isolation- Returns:
-
getTransactionIsolation
public SQLConnection getTransactionIsolation(Handler<AsyncResult<TransactionIsolation>> handler)
Attempts to return the transaction isolation level for this Connection object to the one given.- Parameters:
handler
- the handler called when this operation completes.- Returns:
-
getTransactionIsolation
public SQLConnection getTransactionIsolation()
Attempts to return the transaction isolation level for this Connection object to the one given.- Returns:
-
rxGetTransactionIsolation
public io.reactivex.Single<TransactionIsolation> rxGetTransactionIsolation()
Attempts to return the transaction isolation level for this Connection object to the one given.- Returns:
-
newInstance
public static SQLConnection newInstance(SQLConnection arg)
-
-