Class JdbcParameterBinder

java.lang.Object
org.apache.arrow.adapter.jdbc.JdbcParameterBinder

public class JdbcParameterBinder extends Object
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.

  • 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 - The VectorSchemaRoot 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

      public boolean next() throws SQLException
      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(), or PreparedStatement.addBatch().

      Returns:
      true if a row was bound, false if rows were exhausted
      Throws:
      SQLException