com.mysql.cj

## Interface QueryAttributesBindings

    public interface QueryAttributesBindings

Instances of this interface keep the list of query attributes assigned to a `Statement` object.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `clearAttributes()` Removes all query attributes from the query attributes list.
`BindValue` `getAttributeValue(int index)` Returns an internal representation of the query attribute in the given position of the query attributes list.
`int` `getCount()` Get the count of query attributes in the list.
`void` `runThroughAll(Consumer<BindValue> bindAttribute)` Runs through all query attributes while feeding the given `Consumer` with each one of them.
`void` `setAttribute(String name, Object value)` Adds a new query attribute to the list of query attributes.

### Method Detail

#### setAttribute

    void setAttribute(String name,
                      Object value)

Adds a new query attribute to the list of query attributes. Implementations must validate the type of the given the object and reject it or replace it by another representation if not supported, by its String version, for example. Query attribute names are not checked for duplication.

Parameters:
  `name` - the query attribute name.
  `value` - the query attribute value.

#### getCount

    int getCount()

Get the count of query attributes in the list.

Returns:
  the number of query attributes existing in the list.

#### getAttributeValue

    BindValue getAttributeValue(int index)

Returns an internal representation of the query attribute in the given position of the query attributes list. It's implementation dependent what to do when the index value is invalid.

Parameters:
  `index` - the position of the query attribute value to return.
Returns:
  the `BindValue` in the given position of the query attributes list.

#### runThroughAll

    void runThroughAll(Consumer<BindValue> bindAttribute)

Runs through all query attributes while feeding the given `Consumer` with each one of them.

Parameters:
  `bindAttribute` - A `Consumer` for each one of the single query attributes.

#### clearAttributes

    void clearAttributes()

Removes all query attributes from the query attributes list.

Copyright © 2016, 2023, Oracle and/or its affiliates.