liyafan82 commented on code in PR #13589: URL: https://github.com/apache/arrow/pull/13589#discussion_r926583959
########## java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcParameterBinder.java: ########## @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.arrow.adapter.jdbc; + +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.arrow.adapter.jdbc.binder.ColumnBinder; +import org.apache.arrow.util.Preconditions; +import org.apache.arrow.vector.VectorSchemaRoot; + +/** + * A binder binds JDBC prepared statement parameters to rows of Arrow data from a VectorSchemaRoot. + */ +public class JdbcParameterBinder { + private final PreparedStatement statement; + private final VectorSchemaRoot root; + private final ColumnBinder[] binders; + private final int[] parameterIndices; + private int nextRowIndex; + + JdbcParameterBinder( + final PreparedStatement statement, + final VectorSchemaRoot root, + final ColumnBinder[] binders, + int[] parameterIndices) { + this.statement = statement; + this.root = root; + this.binders = binders; + this.parameterIndices = parameterIndices; + this.nextRowIndex = 0; + } + + /** + * Initialize a binder with a builder. + * + * @param statement The statement to bind to. The binder does not maintain ownership of the statement. + * @param root The root to pull data from. The binder does not maintain ownership of the root. Review Comment: "root" -> "vector schema root" or "record batch"? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
