public static void setRecordToStatement()

in flink-connector-jdbc-core/src/main/java/org/apache/flink/connector/jdbc/utils/JdbcUtils.java [76:97]


    public static void setRecordToStatement(PreparedStatement upload, int[] typesArray, Row row)
            throws SQLException {
        if (typesArray != null && typesArray.length > 0 && typesArray.length != row.getArity()) {
            LOG.warn(
                    "Column SQL types array doesn't match arity of passed Row! Check the passed array...");
        }
        if (typesArray == null) {
            // no types provided
            for (int index = 0; index < row.getArity(); index++) {
                LOG.warn(
                        "Unknown column type for column {}. Best effort approach to set its value: {}.",
                        index + 1,
                        row.getField(index));
                upload.setObject(index + 1, row.getField(index));
            }
        } else {
            // types provided
            for (int i = 0; i < row.getArity(); i++) {
                setField(upload, typesArray[i], row.getField(i), i);
            }
        }
    }