Top Description Methods
com.mysql.cj

public Interface QueryAttributesBindings

Known Direct Implementers
com.mysql.cj.NativeQueryAttributesBindings
Imports
java.sql.Statement, java.util.function.Consumer

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

Method Summary

Modifier and TypeMethod and Description
public void
clearAttributes()

Removes all query attributes from the query attributes list.

public boolean

Returns:

true if the specified attribute name already exists.
containsAttribute
(String
the query attribute name.
name
)

Checks if there is already an attribute with the specified name.

public BindValue

Returns:

the BindValue in the given position of the query attributes list.
getAttributeValue
(int
the position of the query attribute value to return.
index
)

Returns an internal representation of the query attribute in the given position of the query attributes list.

public int

Returns:

the number of query attributes existing in the list.
getCount
()

Get the count of query attributes in the list.

public void
removeAttribute(String
the query attribute name.
name
)

Removes the specified query attribute from the list of query attributes.

public void
runThroughAll(Consumer<BindValue>
A Consumer for each one of the single query attributes.
bindAttribute
)

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

public void
setAttribute(String
the query attribute name.
name
,
Object
the query attribute value.
value
)

Adds a new query attribute to the list of query attributes.

Method Detail

clearAttributesback to summary
public void clearAttributes()

Removes all query attributes from the query attributes list.

containsAttributeback to summary
public boolean containsAttribute(String name)

Checks if there is already an attribute with the specified name.

Parameters
name:String

the query attribute name.

Returns:boolean

true if the specified attribute name already exists.

getAttributeValueback to summary
public 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:int

the position of the query attribute value to return.

Returns:BindValue

the BindValue in the given position of the query attributes list.

getCountback to summary
public int getCount()

Get the count of query attributes in the list.

Returns:int

the number of query attributes existing in the list.

removeAttributeback to summary
public void removeAttribute(String name)

Removes the specified query attribute from the list of query attributes.

Parameters
name:String

the query attribute name.

runThroughAllback to summary
public void runThroughAll(Consumer<BindValue> bindAttribute)

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

Parameters
bindAttribute:Consumer<BindValue>

A Consumer for each one of the single query attributes.

setAttributeback to summary
public 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:String

the query attribute name.

value:Object

the query attribute value.