Module org.apache.arrow.flight.sql
Package org.apache.arrow.flight.sql
Class FlightSqlClient.PreparedStatement
java.lang.Object
org.apache.arrow.flight.sql.FlightSqlClient.PreparedStatement
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- FlightSqlClient
Helper class to encapsulate Flight SQL prepared statement logic.
-
Method Summary
Modifier and TypeMethodDescriptionprotected final voidChecks whether this client is open.voidCloses theparameterBindingRoot, which contains the parameter binding from aFlightSqlClient.PreparedStatementoperation, releasing its resources.voidclose()voidclose(CallOption... options) Closes the client.execute(CallOption... options) Executes the prepared statement query on the server.longexecuteUpdate(CallOption... options) Executes the prepared statement update on the server.fetchSchema(CallOption... options) Get the schema of the result set (should be identical togetResultSetSchema()).Returns the Schema of the parameters.Returns the Schema of the resultset.booleanisClosed()Returns if the prepared statement is already closed.voidsetParameters(VectorSchemaRoot parameterBindingRoot) Set theparameterBindingRootcontaining the parameter binding from aFlightSqlClient.PreparedStatementoperation.
-
Method Details
-
setParameters
Set theparameterBindingRootcontaining the parameter binding from aFlightSqlClient.PreparedStatementoperation.- Parameters:
parameterBindingRoot- aVectorSchemaRootobject containing the values to be used in thePreparedStatementsetters.
-
clearParameters
public void clearParameters()Closes theparameterBindingRoot, which contains the parameter binding from aFlightSqlClient.PreparedStatementoperation, releasing its resources. -
getResultSetSchema
Returns the Schema of the resultset.- Returns:
- the Schema of the resultset.
-
getParameterSchema
Returns the Schema of the parameters.- Returns:
- the Schema of the parameters.
-
fetchSchema
Get the schema of the result set (should be identical togetResultSetSchema()). -
execute
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
Executes the prepared statement update on the server.- Parameters:
options- RPC-layer hints for this call.- Returns:
- the count of updated records
-
close
Closes the client.- Parameters:
options- RPC-layer hints for this call.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
isClosed
public boolean isClosed()Returns if the prepared statement is already closed.- Returns:
- true if the prepared statement is already closed.
-