Package org.apache.arrow.adapter.jdbc
Class JdbcParameterBinder
java.lang.Object
org.apache.arrow.adapter.jdbc.JdbcParameterBinder
A binder binds JDBC prepared statement parameters to rows of Arrow data from a VectorSchemaRoot.
Each row of the VectorSchemaRoot will be bound to the configured parameters of the PreparedStatement. One row of data is bound at a time.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JdbcParameterBinder.Builder
builder
(PreparedStatement statement, VectorSchemaRoot root) Initialize a binder with a builder.boolean
next()
Bind the next row of data to the parameters of the statement.void
reset()
Reset the binder (so the root can be updated with new data).
-
Method Details
-
builder
public static JdbcParameterBinder.Builder builder(PreparedStatement statement, VectorSchemaRoot root) Initialize a binder with a builder.- Parameters:
statement
- The statement to bind to. The binder does not maintain ownership of the statement.root
- TheVectorSchemaRoot
to pull data from. The binder does not maintain ownership of the vector schema root.
-
reset
public void reset()Reset the binder (so the root can be updated with new data). -
next
Bind the next row of data to the parameters of the statement.After this, the application should call the desired method on the prepared statement, such as
PreparedStatement.executeUpdate()
, orPreparedStatement.addBatch()
.- Returns:
- true if a row was bound, false if rows were exhausted
- Throws:
SQLException
-