Class AvaticaParameterBinder

java.lang.Object
org.apache.arrow.driver.jdbc.utils.AvaticaParameterBinder

public class AvaticaParameterBinder extends Object
Convert Avatica PreparedStatement parameters from a list of TypedValue to Arrow and bind them to the VectorSchemaRoot representing the PreparedStatement parameters.

NOTE: Make sure to close the parameters VectorSchemaRoot once we're done with them.

  • Constructor Details

    • AvaticaParameterBinder

      public AvaticaParameterBinder(ArrowFlightSqlClientHandler.PreparedStatement preparedStatement, BufferAllocator bufferAllocator)
      Instantiate a new AvaticaParameterBinder.
      Parameters:
      preparedStatement - The PreparedStatement to bind parameters to.
      bufferAllocator - The BufferAllocator to use for allocating memory.
  • Method Details

    • bind

      public void bind(List<org.apache.calcite.avatica.remote.TypedValue> typedValues)
      Bind the given Avatica values to the prepared statement.
      Parameters:
      typedValues - The parameter values.
    • bind

      public void bind(List<org.apache.calcite.avatica.remote.TypedValue> typedValues, int index)
      Bind the given Avatica values to the prepared statement at the given index.
      Parameters:
      typedValues - The parameter values.
      index - index for parameter.