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 void
Checks whether this client is open.void
Closes theparameterBindingRoot
, which contains the parameter binding from aFlightSqlClient.PreparedStatement
operation, releasing its resources.void
close()
void
close
(CallOption... options) Closes the client.execute
(CallOption... options) Executes the prepared statement query on the server.long
executeUpdate
(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.boolean
isClosed()
Returns if the prepared statement is already closed.void
setParameters
(VectorSchemaRoot parameterBindingRoot) Set theparameterBindingRoot
containing the parameter binding from aFlightSqlClient.PreparedStatement
operation.
-
Method Details
-
setParameters
Set theparameterBindingRoot
containing the parameter binding from aFlightSqlClient.PreparedStatement
operation.- Parameters:
parameterBindingRoot
- aVectorSchemaRoot
object containing the values to be used in thePreparedStatement
setters.
-
clearParameters
public void clearParameters()Closes theparameterBindingRoot
, which contains the parameter binding from aFlightSqlClient.PreparedStatement
operation, 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:
close
in interfaceAutoCloseable
-
isClosed
public boolean isClosed()Returns if the prepared statement is already closed.- Returns:
- true if the prepared statement is already closed.
-