Class Poco::Data::ODBC::Utility
Author: Applied Informatics Software Engineering GmbH and Contributors
Date: 2009-11-24

# Poco::Data::ODBC

# class Utility

Library: Data/ODBC
Package: ODBC
Header: Poco/Data/ODBC/Utility.h

## Description

Various utility functions

## Member Summary

Member Functions: cDataType, dataSources, drivers, isError, mapInsert, sqlDataType

## Types

### DSNMap

typedef std::map < std::string, std::string > DSNMap;

### DriverMap

typedef DSNMap DriverMap;

## Member Functions

### cDataType

static int cDataType(
int sqlDataType
);

Returns C data type corresponding to supplied SQL data type.

### dataSources

static DSNMap & dataSources(
DSNMap & dsnMap
);

Returns DSN-description map of available ODBC data sources.

### drivers

static DriverMap & drivers(
DriverMap & driverMap
);

Returns driver-attributes map of available ODBC drivers.

### isError

static bool isError(
SQLRETURN rc
);

Returns true if return code is error

### mapInsert

template < typename MapType, typename KeyArgType, typename ValueArgType > static typename MapType::iterator mapInsert(
MapType & m,
const KeyArgType & k,
const ValueArgType & v
);

Utility map "insert or replace" function (from S. Meyers: Effective STL, Item 24)

### sqlDataType

static int sqlDataType(
int cDataType
);

Returns SQL data type corresponding to supplied C data type.

## Variables

### boolDataType

static const SQLSMALLINT boolDataType;

ODBC size for bool data type.