Class Poco::Data::Binding
Author: Applied Informatics Software Engineering GmbH and Contributors

# Poco::Data

# template < class T >

# class Binding

Library: Data
Package: DataCore
Header: Poco/Data/Binding.h

## Description

Binding maps a value or multiple values (see Binding specializations for STL containers as well as type handlers) to database column(s). Values to be bound can be either mapped directly (by reference) or a copy can be created, depending on the value of the copy argument. To pass a reference to a variable, it is recommended to pass it to the intermediate utility function use(), which will create the proper binding. In cases when a reference is passed to binding, the storage it refers to must be valid at the statement execution time. To pass a copy of a variable, constant or string literal, use utility function bind(). Variables can be passed as either copies or references (i.e. using either use() or bind()). Constants, however, can only be passed as copies. this is best achieved using bind() utility function. An attempt to pass a constant by reference shall result in compile-time error.

## Inheritance

Direct Base Classes: AbstractBinding

All Base Classes: AbstractBinding

## Member Summary

Member Functions: bind, canBind, numOfColumnsHandled, numOfRowsHandled, reset

Inherited Functions: bind, bulkSize, canBind, getBinder, getDirection, isBulk, name, numOfColumnsHandled, numOfRowsHandled, reset, setBinder

## Types

### Ptr

typedef SharedPtr < Type > Ptr;

### Type

typedef Binding < ValType > Type;

### ValPtr

typedef SharedPtr < ValType > ValPtr;

### ValType

typedef T ValType;

## Constructors

### Binding

explicit Binding(
T & val,
const std::string & name = "",
Direction direction = PD_IN
);

Creates the Binding using the passed reference as bound value. If copy is true, a copy of the value referred to is created.

## Destructor

### ~Binding

~Binding();

Destroys the Binding.

## Member Functions

### bind

void bind(
std::size_t pos
);

See also: Poco::Data::AbstractBinding::bind()

### canBind

bool canBind() const;

See also: Poco::Data::AbstractBinding::canBind()

### numOfColumnsHandled

std::size_t numOfColumnsHandled() const;

See also: Poco::Data::AbstractBinding::numOfColumnsHandled()

### numOfRowsHandled

std::size_t numOfRowsHandled() const;

See also: Poco::Data::AbstractBinding::numOfRowsHandled()

### reset

void reset();

See also: Poco::Data::AbstractBinding::reset()