Class FlightSqlClient.PreparedStatement

java.lang.Object
org.apache.arrow.flight.sql.FlightSqlClient.PreparedStatement
All Implemented Interfaces:
AutoCloseable
Enclosing class:
FlightSqlClient

public static class FlightSqlClient.PreparedStatement extends Object implements AutoCloseable
Helper class to encapsulate Flight SQL prepared statement logic.
  • Method Details

    • setParameters

      public void setParameters(VectorSchemaRoot parameterBindingRoot)
      Set the parameterBindingRoot containing the parameter binding from a FlightSqlClient.PreparedStatement operation.
      Parameters:
      parameterBindingRoot - a VectorSchemaRoot object containing the values to be used in the PreparedStatement setters.
    • clearParameters

      public void clearParameters()
      Closes the parameterBindingRoot, which contains the parameter binding from a FlightSqlClient.PreparedStatement operation, releasing its resources.
    • getResultSetSchema

      public Schema getResultSetSchema()
      Returns the Schema of the resultset.
      Returns:
      the Schema of the resultset.
    • getParameterSchema

      public Schema getParameterSchema()
      Returns the Schema of the parameters.
      Returns:
      the Schema of the parameters.
    • fetchSchema

      public SchemaResult fetchSchema(CallOption... options)
      Get the schema of the result set (should be identical to getResultSetSchema()).
    • execute

      public FlightInfo execute(CallOption... options)
      Executes the prepared statement query on the server.
      Parameters:
      options - RPC-layer hints for this call.
      Returns:
      a FlightInfo object representing the stream(s) to fetch.
    • checkOpen

      protected final void checkOpen()
      Checks whether this client is open.
      Throws:
      IllegalStateException - if client is closed.
    • executeUpdate

      public long executeUpdate(CallOption... options)
      Executes the prepared statement update on the server.
      Parameters:
      options - RPC-layer hints for this call.
      Returns:
      the count of updated records
    • close

      public void close(CallOption... options)
      Closes the client.
      Parameters:
      options - RPC-layer hints for this call.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isClosed

      public boolean isClosed()
      Returns if the prepared statement is already closed.
      Returns:
      true if the prepared statement is already closed.