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, dateSync, dateTimeSync, dbmsName, drivers, isError, mapInsert, sizeOf, sqlDataType, timeSync

Types

DSNMap

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

DriverMap

typedef DSNMap DriverMap;

Member Functions

cDataType static inline

static int cDataType(
    int sqlDataType
);

Returns C data type corresponding to supplied SQL data type.

dataSources static

static DSNMap & dataSources(
    DSNMap & dsnMap
);

Returns DSN-description map of available ODBC data sources.

dateSync static inline

static void dateSync(
    Date & dt,
    const SQL_DATE_STRUCT & ts
);

Transfers data from ODBC SQL_DATE_STRUCT to Poco::DateTime.

dateSync static inline

template < typename T, typename F > static void dateSync(
    T & d,
    const F & ds
);

Transfers data from ODBC SQL_DATE_STRUCT container to Poco::DateTime container.

dateSync static

static void dateSync(
    SQL_DATE_STRUCT & ts,
    const Date & dt
);

Transfers data from Poco::Data::Date to ODBC SQL_DATE_STRUCT.

dateSync static inline

template < typename C > static void dateSync(
    std::vector < SQL_DATE_STRUCT > & ds,
    const C & d
);

Transfers data from Poco::Data::Date vector to ODBC SQL_DATE_STRUCT container.

dateTimeSync static

static void dateTimeSync(
    Poco::DateTime & dt,
    const SQL_TIMESTAMP_STRUCT & ts
);

Transfers data from ODBC SQL_TIMESTAMP_STRUCT to Poco::DateTime.

dateTimeSync static inline

template < typename T, typename F > static void dateTimeSync(
    T & dt,
    const F & ts
);

Transfers data from ODBC SQL_TIMESTAMP_STRUCT container to Poco::DateTime container.

dateTimeSync static

static void dateTimeSync(
    SQL_TIMESTAMP_STRUCT & ts,
    const Poco::DateTime & dt
);

Transfers data from Poco::DateTime to ODBC SQL_TIMESTAMP_STRUCT.

dateTimeSync static inline

template < typename C > static void dateTimeSync(
    std::vector < SQL_TIMESTAMP_STRUCT > & ts,
    const C & dt
);

Transfers data from Poco::DateTime to ODBC SQL_TIMESTAMP_STRUCT.

dbmsName static

static std::string dbmsName(
    const ConnectionHandle & db
);

Returns the back end DBMS name. On error, returns "unknown".

drivers static

static DriverMap & drivers(
    DriverMap & driverMap
);

Returns driver-attributes map of available ODBC drivers.

isError static inline

static bool isError(
    SQLRETURN rc
);

Returns true if return code is error

mapInsert static inline

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)

sizeOf static inline

template < typename T > static constexpr SQLINTEGER sizeOf();

Returns size of the data type.

sizeOf static inline

template < typename T > static constexpr SQLINTEGER sizeOf(
    const T & param45
);

Returns size of the data type.

sqlDataType static inline

static int sqlDataType(
    int cDataType
);

Returns SQL data type corresponding to supplied C data type.

timeSync static inline

static void timeSync(
    Time & dt,
    const SQL_TIME_STRUCT & ts
);

Transfers data from ODBC SQL_TIME_STRUCT to Poco::DateTime.

timeSync static inline

template < typename T, typename F > static void timeSync(
    T & t,
    const F & ts
);

Transfers data from ODBC SQL_TIME_STRUCT container to Poco::DateTime container.

timeSync static

static void timeSync(
    SQL_TIME_STRUCT & ts,
    const Time & dt
);

Transfers data from Poco::Data::Time to ODBC SQL_TIME_STRUCT.

timeSync static inline

template < typename C > static void timeSync(
    std::vector < SQL_TIME_STRUCT > & ts,
    const C & t
);

Transfers data from Poco::Data::Time container to ODBC SQL_TIME_STRUCT vector.

Variables

MS_SQL_SERVER_DBMS_NAME static

inline static const std::string MS_SQL_SERVER_DBMS_NAME = "Microsoft SQL Server" s;