Class Executor

java.lang.Object
com.amazon.rdsdata.client.Executor

public class Executor
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    Executor​(java.lang.String sql, RdsDataClient client)  
  • Method Summary

    Modifier and Type Method Description
    ExecutionResult execute()
    Executes the SQL query.
    Executor withParameter​(java.lang.Object param)
    Sets a single parameter set
    Executor withParameter​(java.lang.String parameterName, java.lang.Object value)
    Sets a single named parameter.
    Executor withParamSets​(java.lang.Object... params)
    Sets multiple parameter sets
    Executor withParamSets​(java.util.List<java.lang.Object> params)
    Sets multiple parameter sets
    Executor withTransactionId​(java.lang.String transactionId)
    Specifies that the query should be executed in a transaction

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • withParameter

      public Executor withParameter​(java.lang.Object param)
      Sets a single parameter set
      Parameters:
      param - object which fields will be used as a source for parameters
      Returns:
      a reference to this object so that method calls can be chained together
    • withParamSets

      public Executor withParamSets​(java.util.List<java.lang.Object> params)
      Sets multiple parameter sets
      Parameters:
      params - List of objects which fields will be used as sources for parameters
      Returns:
      a reference to this object so that method calls can be chained together
    • withParamSets

      public Executor withParamSets​(java.lang.Object... params)
      Sets multiple parameter sets
      Parameters:
      params - vararg array of objects which fields will be sources for parameters
      Returns:
      a reference to this object so that method calls can be chained together
    • withParameter

      public Executor withParameter​(java.lang.String parameterName, java.lang.Object value)
      Sets a single named parameter. Should not be combined with withParameter(Object) and withParamSets(Object...)
      Parameters:
      parameterName - Name of the parameter
      value - value (can be of any supported type)
      Returns:
      a reference to this object so that method calls can be chained together
    • execute

      public ExecutionResult execute()
      Executes the SQL query. If only one parameter set was added to this Executor before, or no parameters at all, ExecuteStatement API will be called If more than one parameter set was added (via withParamSets() methods), BatchExecuteStatement API will be used
      Returns:
      a ExecutionResult instance
    • withTransactionId

      public Executor withTransactionId​(java.lang.String transactionId)
      Specifies that the query should be executed in a transaction
      Parameters:
      transactionId - transaction ID
      Returns:
      a reference to this object so that method calls can be chained together