public class TransactionExecutor extends Object implements Executable
Constructor and Description |
---|
TransactionExecutor(Transaction transaction)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
abort()
Abort the transaction and roll back any changes.
|
Result |
execute(String statement)
Execute the statement against QLDB and retrieve the result.
|
Result |
execute(String statement,
com.amazon.ion.IonValue... parameters)
Execute the statement using the specified parameters against QLDB and retrieve the result.
|
Result |
execute(String statement,
List<com.amazon.ion.IonValue> parameters)
Execute the statement using the specified parameters against QLDB and retrieve the result.
|
String |
getTransactionId()
Get the ID of the current transaction.
|
public TransactionExecutor(Transaction transaction)
transaction
- The transaction object the TransactionExecutor wraps.public void abort()
public Result execute(String statement)
execute
in interface Executable
statement
- The PartiQL statement to be executed against QLDB.com.amazonaws.AmazonClientException
- if there is an error executing against QLDB.public Result execute(String statement, List<com.amazon.ion.IonValue> parameters)
execute
in interface Executable
statement
- The PartiQL statement to be executed against QLDB.parameters
- The parameters to be used with the PartiQL statement, for each ? placeholder in the statement.com.amazonaws.AmazonClientException
- if there is an error executing against QLDB.public Result execute(String statement, com.amazon.ion.IonValue... parameters)
execute
in interface Executable
statement
- The PartiQL statement to be executed against QLDB.parameters
- The parameters to be used with the PartiQL statement, for each ? placeholder in the statement.com.amazonaws.AmazonClientException
- if there is an error executing against QLDB.public String getTransactionId()