mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 10:32:57 +01:00
[SF 2272430] BLOB and CLOB
Renamed: (Abstract)Preparation => (Abstract)Preparator (Abstract)Prepare => (Abstract)Preparation
This commit is contained in:
parent
161e49a6d4
commit
a42e8d919b
@ -265,7 +265,7 @@
|
||||
RelativePath=".\include\Poco\Data\AbstractPreparation.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\AbstractPrepare.h">
|
||||
RelativePath=".\include\Poco\Data\AbstractPreparator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\AbstractSessionImpl.h">
|
||||
@ -276,12 +276,6 @@
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Binding.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\BLOB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\BLOBStream.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Bulk.h">
|
||||
</File>
|
||||
@ -315,6 +309,12 @@
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Limit.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\LOB.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\LOBStream.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\MetaColumn.h">
|
||||
</File>
|
||||
@ -389,13 +389,7 @@
|
||||
RelativePath=".\src\AbstractPreparation.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\AbstractPrepare.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\BLOB.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\BLOBStream.h">
|
||||
RelativePath=".\src\AbstractPreparator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Bulk.cpp">
|
||||
|
@ -374,7 +374,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\AbstractPrepare.h"
|
||||
RelativePath=".\include\Poco\Data\AbstractPreparator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -389,14 +389,6 @@
|
||||
RelativePath=".\include\Poco\Data\Binding.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\BLOB.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\BLOBStream.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Bulk.h"
|
||||
>
|
||||
@ -437,6 +429,14 @@
|
||||
RelativePath=".\include\Poco\Data\Limit.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\LOB.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\LOBStream.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\MetaColumn.h"
|
||||
>
|
||||
@ -446,7 +446,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Prepare.h"
|
||||
RelativePath=".\include\Poco\Data\Preparation.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -534,21 +534,13 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\AbstractPrepare.cpp"
|
||||
RelativePath=".\src\AbstractPreparator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\AutoTransaction.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\BLOB.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\BLOBStream.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Bulk.cpp"
|
||||
>
|
||||
|
@ -371,7 +371,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\AbstractPrepare.h"
|
||||
RelativePath=".\include\Poco\Data\AbstractPreparator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -386,14 +386,6 @@
|
||||
RelativePath=".\include\Poco\Data\Binding.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\BLOB.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\BLOBStream.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Bulk.h"
|
||||
>
|
||||
@ -438,6 +430,14 @@
|
||||
RelativePath=".\include\Poco\Data\Limit.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\LOB.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\LOBStream.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\MetaColumn.h"
|
||||
>
|
||||
@ -539,21 +539,13 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\AbstractPrepare.cpp"
|
||||
RelativePath=".\src\AbstractPreparator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\AutoTransaction.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\BLOB.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\BLOBStream.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Bulk.cpp"
|
||||
>
|
||||
|
@ -9,8 +9,8 @@
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
|
||||
objects = AbstractBinder AbstractBinding AbstractExtraction AbstractExtractor \
|
||||
AbstractPreparation AbstractPrepare ArchiveStrategy AutoTransaction \
|
||||
Bulk Connector BLOB BLOBStream DataException Date Limit MetaColumn \
|
||||
AbstractPreparation AbstractPreparator ArchiveStrategy AutoTransaction \
|
||||
Bulk Connector DataException Date Limit MetaColumn \
|
||||
PooledSessionHolder PooledSessionImpl Position \
|
||||
Range RecordSet Row RowFilter RowFormatter RowIterator \
|
||||
SimpleRowFormatter Session SessionFactory SessionImpl \
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
#include "Poco/Data/MySQL/MySQL.h"
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/MySQL/MySQLException.h"
|
||||
#include <mysql.h>
|
||||
|
||||
@ -104,10 +104,13 @@ public:
|
||||
|
||||
virtual void bind(std::size_t pos, const std::string& val, Direction dir);
|
||||
/// Binds a string.
|
||||
|
||||
|
||||
virtual void bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir);
|
||||
/// Binds a BLOB.
|
||||
|
||||
virtual void bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir);
|
||||
/// Binds a CLOB.
|
||||
|
||||
virtual void bind(std::size_t pos, const DateTime& val, Direction dir);
|
||||
/// Binds a DateTime.
|
||||
|
||||
@ -199,6 +202,12 @@ public:
|
||||
|
||||
virtual void bind(std::size_t pos, const std::list<BLOB>& val, Direction dir = PD_IN);
|
||||
|
||||
virtual void bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir = PD_IN);
|
||||
|
||||
virtual void bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir = PD_IN);
|
||||
|
||||
virtual void bind(std::size_t pos, const std::list<CLOB>& val, Direction dir = PD_IN);
|
||||
|
||||
virtual void bind(std::size_t pos, const std::vector<DateTime>& val, Direction dir = PD_IN);
|
||||
|
||||
virtual void bind(std::size_t pos, const std::deque<DateTime>& val, Direction dir = PD_IN);
|
||||
@ -235,8 +244,8 @@ public:
|
||||
MYSQL_BIND* getBindArray() const;
|
||||
/// Return array
|
||||
|
||||
//void updateDates();
|
||||
/// Update linked times
|
||||
//void updateDates();
|
||||
/// Update linked times
|
||||
|
||||
private:
|
||||
|
||||
@ -253,7 +262,7 @@ private:
|
||||
private:
|
||||
|
||||
std::vector<MYSQL_BIND> _bindArray;
|
||||
std::vector<MYSQL_TIME> _dates;
|
||||
std::vector<MYSQL_TIME> _dates;
|
||||
};
|
||||
|
||||
|
||||
|
@ -44,10 +44,15 @@
|
||||
#include "Poco/Data/MySQL/StatementExecutor.h"
|
||||
#include "Poco/Data/MySQL/ResultMetadata.h"
|
||||
#include "Poco/Data/AbstractExtractor.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
namespace Dynamic {
|
||||
class Var;
|
||||
}
|
||||
|
||||
namespace Data {
|
||||
namespace MySQL {
|
||||
|
||||
@ -100,16 +105,19 @@ public:
|
||||
|
||||
virtual bool extract(std::size_t pos, double& val);
|
||||
/// Extracts a double.
|
||||
|
||||
|
||||
virtual bool extract(std::size_t pos, char& val);
|
||||
/// Extracts a single character.
|
||||
|
||||
|
||||
virtual bool extract(std::size_t pos, std::string& val);
|
||||
/// Extracts a string.
|
||||
|
||||
|
||||
virtual bool extract(std::size_t pos, Poco::Data::BLOB& val);
|
||||
/// Extracts a BLOB.
|
||||
|
||||
virtual bool extract(std::size_t pos, Poco::Data::CLOB& val);
|
||||
/// Extracts a CLOB.
|
||||
|
||||
virtual bool extract(std::size_t pos, DateTime& val);
|
||||
/// Extracts a DateTime. Returns false if null was received.
|
||||
|
||||
@ -122,8 +130,8 @@ public:
|
||||
virtual bool extract(std::size_t pos, Any& val);
|
||||
/// Extracts an Any. Returns false if null was received.
|
||||
|
||||
virtual bool extract(std::size_t pos, DynamicAny& val);
|
||||
/// Extracts a DynamicAny. Returns false if null was received.
|
||||
virtual bool extract(std::size_t pos, Dynamic::Var& val);
|
||||
/// Extracts a Dynamic::Var. Returns false if null was received.
|
||||
|
||||
virtual bool isNull(std::size_t col, std::size_t row);
|
||||
/// Returns true if the value at [col,row] position is null.
|
||||
@ -131,7 +139,7 @@ public:
|
||||
virtual void reset();
|
||||
/// Resets any information internally cached by the extractor.
|
||||
|
||||
////////////
|
||||
////////////
|
||||
// Not implemented extract functions
|
||||
////////////
|
||||
|
||||
@ -272,6 +280,15 @@ public:
|
||||
virtual bool extract(std::size_t pos, std::list<BLOB>& val);
|
||||
/// Extracts a BLOB list.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::vector<CLOB>& val);
|
||||
/// Extracts a CLOB vector.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::deque<CLOB>& val);
|
||||
/// Extracts a CLOB deque.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::list<CLOB>& val);
|
||||
/// Extracts a CLOB list.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::vector<DateTime>& val);
|
||||
/// Extracts a DateTime vector.
|
||||
|
||||
@ -308,14 +325,14 @@ public:
|
||||
virtual bool extract(std::size_t pos, std::list<Any>& val);
|
||||
/// Extracts an Any list.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::vector<DynamicAny>& val);
|
||||
/// Extracts a DynamicAny vector.
|
||||
virtual bool extract(std::size_t pos, std::vector<Dynamic::Var>& val);
|
||||
/// Extracts a Dynamic::Var vector.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::deque<DynamicAny>& val);
|
||||
/// Extracts a DynamicAny deque.
|
||||
virtual bool extract(std::size_t pos, std::deque<Dynamic::Var>& val);
|
||||
/// Extracts a Dynamic::Var deque.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::list<DynamicAny>& val);
|
||||
/// Extracts a DynamicAny list.
|
||||
virtual bool extract(std::size_t pos, std::list<Dynamic::Var>& val);
|
||||
/// Extracts a Dynamic::Var list.
|
||||
|
||||
private:
|
||||
|
||||
|
@ -112,9 +112,9 @@ private:
|
||||
};
|
||||
|
||||
StatementExecutor _stmt;
|
||||
ResultMetadata _metadata;
|
||||
Binder _binder;
|
||||
Extractor _extractor;
|
||||
ResultMetadata _metadata;
|
||||
Binder _binder;
|
||||
Extractor _extractor;
|
||||
int _hasNext;
|
||||
};
|
||||
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
std::size_t length(std::size_t pos) const;
|
||||
/// Returns the length.
|
||||
|
||||
const char* rawData(std::size_t pos) const;
|
||||
const unsigned char* rawData(std::size_t pos) const;
|
||||
/// Returns raw data.
|
||||
|
||||
bool isNull(std::size_t pos) const;
|
||||
|
@ -45,7 +45,7 @@ namespace MySQL {
|
||||
Binder::Binder()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binder::~Binder()
|
||||
{
|
||||
@ -54,56 +54,56 @@ Binder::~Binder()
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int8& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_TINY, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt8& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_TINY, &val, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int16& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_SHORT, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt16& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_SHORT, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int32& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_LONG, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt32& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_LONG, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Int64& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_LONGLONG, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::UInt64& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_LONGLONG, &val, 0);
|
||||
}
|
||||
|
||||
@ -111,111 +111,118 @@ void Binder::bind(std::size_t pos, const Poco::UInt64& val, Direction dir)
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void Binder::bind(std::size_t pos, const long& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_LONGLONG, &val, 0);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_LONGLONG, &val, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const bool& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_TINY, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const float& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_FLOAT, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const double& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_DOUBLE, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const char& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_TINY, &val, 0);
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_STRING, val.c_str(), static_cast<int>(val.length()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_BLOB, val.rawContent(), static_cast<int>(val.size()));
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_BLOB, val.rawContent(), static_cast<int>(val.size()));
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const DateTime& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
MYSQL_TIME mt = {0};
|
||||
poco_assert(dir == PD_IN);
|
||||
MYSQL_TIME mt = {0};
|
||||
|
||||
mt.year = val.year();
|
||||
mt.month = val.month();
|
||||
mt.day = val.day();
|
||||
mt.hour = val.hour();
|
||||
mt.minute = val.minute();
|
||||
mt.second = val.second();
|
||||
mt.second_part = val.millisecond();
|
||||
|
||||
mt.time_type = MYSQL_TIMESTAMP_DATETIME;
|
||||
|
||||
_dates.push_back(mt);
|
||||
|
||||
realBind(pos, MYSQL_TYPE_DATETIME, &_dates.back(), sizeof(mt));
|
||||
mt.year = val.year();
|
||||
mt.month = val.month();
|
||||
mt.day = val.day();
|
||||
mt.hour = val.hour();
|
||||
mt.minute = val.minute();
|
||||
mt.second = val.second();
|
||||
mt.second_part = val.millisecond();
|
||||
|
||||
mt.time_type = MYSQL_TIMESTAMP_DATETIME;
|
||||
|
||||
_dates.push_back(mt);
|
||||
|
||||
realBind(pos, MYSQL_TYPE_DATETIME, &_dates.back(), sizeof(mt));
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Date& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
MYSQL_TIME mt = {0};
|
||||
poco_assert(dir == PD_IN);
|
||||
MYSQL_TIME mt = {0};
|
||||
|
||||
mt.year = val.year();
|
||||
mt.month = val.month();
|
||||
mt.day = val.day();
|
||||
mt.year = val.year();
|
||||
mt.month = val.month();
|
||||
mt.day = val.day();
|
||||
|
||||
_dates.push_back(mt);
|
||||
|
||||
realBind(pos, MYSQL_TYPE_DATE, &_dates.back(), sizeof(mt));
|
||||
_dates.push_back(mt);
|
||||
|
||||
realBind(pos, MYSQL_TYPE_DATE, &_dates.back(), sizeof(mt));
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Time& val, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
MYSQL_TIME mt = {0};
|
||||
poco_assert(dir == PD_IN);
|
||||
MYSQL_TIME mt = {0};
|
||||
|
||||
mt.hour = val.hour();
|
||||
mt.minute = val.minute();
|
||||
mt.second = val.second();
|
||||
mt.hour = val.hour();
|
||||
mt.minute = val.minute();
|
||||
mt.second = val.second();
|
||||
|
||||
mt.time_type = MYSQL_TIMESTAMP_TIME;
|
||||
|
||||
_dates.push_back(mt);
|
||||
|
||||
realBind(pos, MYSQL_TYPE_TIME, &_dates.back(), sizeof(mt));
|
||||
mt.time_type = MYSQL_TIMESTAMP_TIME;
|
||||
|
||||
_dates.push_back(mt);
|
||||
|
||||
realBind(pos, MYSQL_TYPE_TIME, &_dates.back(), sizeof(mt));
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const NullData&, Direction dir)
|
||||
{
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_NULL, 0, 0);
|
||||
poco_assert(dir == PD_IN);
|
||||
realBind(pos, MYSQL_TYPE_NULL, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -238,31 +245,31 @@ MYSQL_BIND* Binder::getBindArray() const
|
||||
|
||||
/*void Binder::updateDates()
|
||||
{
|
||||
for (size_t i = 0; i < _dates.size(); i++)
|
||||
{
|
||||
switch (_dates[i].mt.time_type)
|
||||
{
|
||||
case MYSQL_TIMESTAMP_DATE:
|
||||
_dates[i].mt.year = _dates[i].link.date->year();
|
||||
_dates[i].mt.month = _dates[i].link.date->month();
|
||||
_dates[i].mt.day = _dates[i].link.date->day();
|
||||
break;
|
||||
case MYSQL_TIMESTAMP_DATETIME:
|
||||
_dates[i].mt.year = _dates[i].link.dateTime->year();
|
||||
_dates[i].mt.month = _dates[i].link.dateTime->month();
|
||||
_dates[i].mt.day = _dates[i].link.dateTime->day();
|
||||
_dates[i].mt.hour = _dates[i].link.dateTime->hour();
|
||||
_dates[i].mt.minute = _dates[i].link.dateTime->minute();
|
||||
_dates[i].mt.second = _dates[i].link.dateTime->second();
|
||||
_dates[i].mt.second_part = _dates[i].link.dateTime->millisecond();
|
||||
break;
|
||||
case MYSQL_TIMESTAMP_TIME:
|
||||
_dates[i].mt.hour = _dates[i].link.time->hour();
|
||||
_dates[i].mt.minute = _dates[i].link.time->minute();
|
||||
_dates[i].mt.second = _dates[i].link.time->second();
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < _dates.size(); i++)
|
||||
{
|
||||
switch (_dates[i].mt.time_type)
|
||||
{
|
||||
case MYSQL_TIMESTAMP_DATE:
|
||||
_dates[i].mt.year = _dates[i].link.date->year();
|
||||
_dates[i].mt.month = _dates[i].link.date->month();
|
||||
_dates[i].mt.day = _dates[i].link.date->day();
|
||||
break;
|
||||
case MYSQL_TIMESTAMP_DATETIME:
|
||||
_dates[i].mt.year = _dates[i].link.dateTime->year();
|
||||
_dates[i].mt.month = _dates[i].link.dateTime->month();
|
||||
_dates[i].mt.day = _dates[i].link.dateTime->day();
|
||||
_dates[i].mt.hour = _dates[i].link.dateTime->hour();
|
||||
_dates[i].mt.minute = _dates[i].link.dateTime->minute();
|
||||
_dates[i].mt.second = _dates[i].link.dateTime->second();
|
||||
_dates[i].mt.second_part = _dates[i].link.dateTime->millisecond();
|
||||
break;
|
||||
case MYSQL_TIMESTAMP_TIME:
|
||||
_dates[i].mt.hour = _dates[i].link.time->hour();
|
||||
_dates[i].mt.minute = _dates[i].link.time->minute();
|
||||
_dates[i].mt.second = _dates[i].link.time->second();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
///////////////////
|
||||
@ -284,7 +291,7 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer
|
||||
MYSQL_BIND b = {0};
|
||||
|
||||
b.buffer_type = type;
|
||||
b.buffer = const_cast<void*>(buffer);
|
||||
b.buffer = const_cast<void*>(buffer);
|
||||
b.buffer_length = length;
|
||||
|
||||
_bindArray[pos] = b;
|
||||
@ -293,325 +300,343 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Int8>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Int8>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Int8>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt8>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::UInt8>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::UInt8>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Int16>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Int16>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Int16>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt16>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::UInt16>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::UInt16>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Int32>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Int32>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Int32>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt32>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::UInt32>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::UInt32>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Int64>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Int64>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Int64>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::UInt64>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::UInt64>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::UInt64>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<bool>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<bool>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<bool>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<float>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<float>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<float>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<double>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<double>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<double>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<char>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<char>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<char>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::BLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Data::BLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Data::BLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::CLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Data::CLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Data::CLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::DateTime>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::DateTime>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::DateTime>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::Date>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Data::Date>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Data::Date>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::Time>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Data::Time>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Data::Time>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<Poco::Data::NullData>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<Poco::Data::NullData>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<Poco::Data::NullData>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::vector<std::string>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::deque<std::string>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const std::list<std::string>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException();
|
||||
throw NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,201 +53,217 @@ Extractor::~Extractor()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int8& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt8& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int16& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_SHORT, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_SHORT, &val);
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt16& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_SHORT, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_SHORT, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int32& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt32& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONG, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int64& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONGLONG, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONGLONG, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONGLONG, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONGLONG, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t pos, long& val)
|
||||
/// Extracts a long. Returns false if null was received.
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONGLONG, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_LONGLONG, &val);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, bool& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, float& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_FLOAT, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_FLOAT, &val);
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, double& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_DOUBLE, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_DOUBLE, &val);
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, char& val)
|
||||
{
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
return realExtractFixed(pos, MYSQL_TYPE_TINY, &val);
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::string& val)
|
||||
{
|
||||
if (_metadata.columnsReturned() <= pos)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
|
||||
if (_metadata.columnsReturned() <= pos)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
|
||||
return false;
|
||||
|
||||
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_STRING)
|
||||
throw MySQLException("Extractor: not a string");
|
||||
|
||||
val.assign(_metadata.rawData(pos), _metadata.length(pos));
|
||||
return true;
|
||||
|
||||
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_STRING)
|
||||
throw MySQLException("Extractor: not a string");
|
||||
|
||||
val.assign(reinterpret_cast<const char*>(_metadata.rawData(pos)), _metadata.length(pos));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
if (_metadata.columnsReturned() <= pos)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
|
||||
if (_metadata.columnsReturned() <= pos)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
|
||||
return false;
|
||||
|
||||
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB)
|
||||
throw MySQLException("Extractor: not a blob");
|
||||
|
||||
val.assignRaw(_metadata.rawData(pos), _metadata.length(pos));
|
||||
return true;
|
||||
|
||||
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB)
|
||||
throw MySQLException("Extractor: not a blob");
|
||||
|
||||
val.assignRaw(_metadata.rawData(pos), _metadata.length(pos));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
|
||||
{
|
||||
if (_metadata.columnsReturned() <= pos)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(pos)))
|
||||
return false;
|
||||
|
||||
if (_metadata.metaColumn(static_cast<Poco::UInt32>(pos)).type() != Poco::Data::MetaColumn::FDT_BLOB)
|
||||
throw MySQLException("Extractor: not a blob");
|
||||
|
||||
val.assignRaw(reinterpret_cast<const char*>(_metadata.rawData(pos)), _metadata.length(pos));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, DateTime& val)
|
||||
{
|
||||
MYSQL_TIME mt = {0};
|
||||
MYSQL_TIME mt = {0};
|
||||
|
||||
if (!realExtractFixed(pos, MYSQL_TYPE_DATETIME, &mt))
|
||||
return false;
|
||||
if (!realExtractFixed(pos, MYSQL_TYPE_DATETIME, &mt))
|
||||
return false;
|
||||
|
||||
val.assign(mt.year, mt.month, mt.day, mt.hour, mt.minute, mt.second, mt.second_part, 0);
|
||||
return true;
|
||||
val.assign(mt.year, mt.month, mt.day, mt.hour, mt.minute, mt.second, mt.second_part, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Date& val)
|
||||
{
|
||||
MYSQL_TIME mt = {0};
|
||||
MYSQL_TIME mt = {0};
|
||||
|
||||
if (!realExtractFixed(pos, MYSQL_TYPE_DATE, &mt))
|
||||
return false;
|
||||
if (!realExtractFixed(pos, MYSQL_TYPE_DATE, &mt))
|
||||
return false;
|
||||
|
||||
val.assign(mt.year, mt.month, mt.day);
|
||||
return true;
|
||||
val.assign(mt.year, mt.month, mt.day);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Time& val)
|
||||
{
|
||||
MYSQL_TIME mt = {0};
|
||||
MYSQL_TIME mt = {0};
|
||||
|
||||
if (!realExtractFixed(pos, MYSQL_TYPE_TIME, &mt))
|
||||
return false;
|
||||
if (!realExtractFixed(pos, MYSQL_TYPE_TIME, &mt))
|
||||
return false;
|
||||
|
||||
val.assign(mt.hour, mt.minute, mt.second);
|
||||
return true;
|
||||
val.assign(mt.hour, mt.minute, mt.second);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Any& val)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, DynamicAny& val)
|
||||
bool Extractor::extract(std::size_t pos, Dynamic::Var& val)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::isNull(std::size_t col, std::size_t row)
|
||||
{
|
||||
poco_assert(row == POCO_DATA_INVALID_ROW);
|
||||
poco_assert(row == POCO_DATA_INVALID_ROW);
|
||||
|
||||
if (_metadata.columnsReturned() <= col)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
if (_metadata.columnsReturned() <= col)
|
||||
throw MySQLException("Extractor: attempt to extract more paremeters, than query result contain");
|
||||
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(col)))
|
||||
return true;
|
||||
if (_metadata.isNull(static_cast<Poco::UInt32>(col)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Extractor::reset()
|
||||
{
|
||||
AbstractExtractor::reset();
|
||||
AbstractExtractor::reset();
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, size_t length)
|
||||
{
|
||||
MYSQL_BIND bind = {0};
|
||||
my_bool isNull = 0;
|
||||
MYSQL_BIND bind = {0};
|
||||
my_bool isNull = 0;
|
||||
|
||||
bind.is_null = &isNull;
|
||||
bind.buffer_type = type;
|
||||
bind.buffer = buffer;
|
||||
bind.buffer_length = static_cast<unsigned long>(length);
|
||||
|
||||
if (!_stmt.fetchColumn(pos, &bind))
|
||||
return false;
|
||||
bind.is_null = &isNull;
|
||||
bind.buffer_type = type;
|
||||
bind.buffer = buffer;
|
||||
bind.buffer_length = static_cast<unsigned long>(length);
|
||||
|
||||
if (!_stmt.fetchColumn(pos, &bind))
|
||||
return false;
|
||||
|
||||
return isNull == 0;
|
||||
return isNull == 0;
|
||||
}
|
||||
|
||||
|
||||
@ -258,363 +274,381 @@ bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* b
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::Int8>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::Int8>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::Int8>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::UInt8>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::UInt8>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::UInt8>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::Int16>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::Int16>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::Int16>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::UInt16>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::UInt16>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::UInt16>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::Int32>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::Int32>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::Int32>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::UInt32>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::UInt32>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::UInt32>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::Int64>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::Int64>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::Int64>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Poco::UInt64>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Poco::UInt64>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Poco::UInt64>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t , std::vector<long>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<long>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<long>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<bool>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<bool>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<bool>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<float>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<float>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<float>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<double>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<double>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<double>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<char>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<char>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<char>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<std::string>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<std::string>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<std::string>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<BLOB>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<BLOB>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<BLOB>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<CLOB>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<CLOB>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<CLOB>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<DateTime>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<DateTime>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<DateTime>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Date>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Date>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Date>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Time>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Time>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Time>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<Any>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<Any>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<Any>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::vector<DynamicAny>& )
|
||||
bool Extractor::extract(std::size_t , std::vector<Dynamic::Var>& )
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::deque<DynamicAny>& )
|
||||
bool Extractor::extract(std::size_t , std::deque<Dynamic::Var>& )
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t , std::list<DynamicAny>& )
|
||||
bool Extractor::extract(std::size_t , std::list<Dynamic::Var>& )
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
|
@ -80,12 +80,12 @@ namespace
|
||||
case MYSQL_TYPE_DOUBLE: return sizeof(double);
|
||||
case MYSQL_TYPE_LONGLONG: return sizeof(Poco::Int64);
|
||||
|
||||
case MYSQL_TYPE_DATE:
|
||||
case MYSQL_TYPE_TIME:
|
||||
case MYSQL_TYPE_DATETIME:
|
||||
return sizeof(MYSQL_TIME);
|
||||
case MYSQL_TYPE_DATE:
|
||||
case MYSQL_TYPE_TIME:
|
||||
case MYSQL_TYPE_DATETIME:
|
||||
return sizeof(MYSQL_TIME);
|
||||
|
||||
case MYSQL_TYPE_DECIMAL:
|
||||
case MYSQL_TYPE_DECIMAL:
|
||||
case MYSQL_TYPE_NEWDECIMAL:
|
||||
case MYSQL_TYPE_STRING:
|
||||
case MYSQL_TYPE_VAR_STRING:
|
||||
@ -94,7 +94,7 @@ namespace
|
||||
case MYSQL_TYPE_LONG_BLOB:
|
||||
case MYSQL_TYPE_BLOB:
|
||||
return field.length;
|
||||
|
||||
|
||||
default:
|
||||
throw Poco::Data::MySQL::StatementException("unknown field type");
|
||||
}
|
||||
@ -140,9 +140,9 @@ namespace
|
||||
case MYSQL_TYPE_BLOB:
|
||||
return Poco::Data::MetaColumn::FDT_BLOB;
|
||||
default:
|
||||
return Poco::Data::MetaColumn::FDT_UNKNOWN;
|
||||
return Poco::Data::MetaColumn::FDT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ void ResultMetadata::init(MYSQL_STMT* stmt)
|
||||
fields[i].name, // name
|
||||
fieldType(fields[i]), // type
|
||||
fieldSize(fields[i]), // length
|
||||
0, // TODO: precision (Now I dont know how to get it)
|
||||
0, // TODO: precision
|
||||
!IS_NOT_NULL(fields[i].flags) // nullable
|
||||
));
|
||||
|
||||
@ -232,14 +232,14 @@ size_t ResultMetadata::length(size_t pos) const
|
||||
return _lengths[pos];
|
||||
}
|
||||
|
||||
const char* ResultMetadata::rawData(size_t pos) const
|
||||
const unsigned char* ResultMetadata::rawData(size_t pos) const
|
||||
{
|
||||
return reinterpret_cast<const char*>(_row[pos].buffer);
|
||||
return reinterpret_cast<const unsigned char*>(_row[pos].buffer);
|
||||
}
|
||||
|
||||
bool ResultMetadata::isNull(size_t pos) const
|
||||
{
|
||||
return (_isNull[pos] != 0);
|
||||
return (_isNull[pos] != 0);
|
||||
}
|
||||
|
||||
}}} // namespace Poco::Data::MySQL
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "Poco/Tuple.h"
|
||||
#include "Poco/NamedTuple.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/MySQL/Connector.h"
|
||||
#include "Poco/Data/MySQL/MySQLException.h"
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "Poco/Tuple.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/RecordSet.h"
|
||||
#include "Poco/Data/MySQL/Connector.h"
|
||||
@ -118,7 +118,7 @@ public:
|
||||
pBinder->bind(pos++, obj.age, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, Person& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPrepare)
|
||||
{
|
||||
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
@ -1257,7 +1257,7 @@ void SQLExecutor::blob(int bigSize)
|
||||
std::string firstName("firstname");
|
||||
std::string address("Address");
|
||||
|
||||
Poco::Data::BLOB img("0123456789", 10);
|
||||
Poco::Data::CLOB img("0123456789", 10);
|
||||
int count = 0;
|
||||
try { *_pSession << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(img), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
|
||||
@ -1267,14 +1267,14 @@ void SQLExecutor::blob(int bigSize)
|
||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
|
||||
assert (count == 1);
|
||||
|
||||
Poco::Data::BLOB res;
|
||||
Poco::Data::CLOB res;
|
||||
assert (res.size() == 0);
|
||||
try { *_pSession << "SELECT Image FROM Person", into(res), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.displayText() << std::endl; fail (funct); }
|
||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
|
||||
assert (res == img);
|
||||
|
||||
Poco::Data::BLOB big;
|
||||
Poco::Data::CLOB big;
|
||||
std::vector<char> v(bigSize, 'x');
|
||||
big.assignRaw(&v[0], v.size());
|
||||
|
||||
@ -1300,7 +1300,7 @@ void SQLExecutor::blobStmt()
|
||||
std::string lastName("lastname");
|
||||
std::string firstName("firstname");
|
||||
std::string address("Address");
|
||||
Poco::Data::BLOB blob("0123456789", 10);
|
||||
Poco::Data::CLOB blob("0123456789", 10);
|
||||
|
||||
int count = 0;
|
||||
Statement ins = (*_pSession << "INSERT INTO Person VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(blob));
|
||||
@ -1310,7 +1310,7 @@ void SQLExecutor::blobStmt()
|
||||
catch(StatementException& se){ std::cout << se.displayText() << std::endl; fail (funct); }
|
||||
assert (count == 1);
|
||||
|
||||
Poco::Data::BLOB res;
|
||||
Poco::Data::CLOB res;
|
||||
poco_assert (res.size() == 0);
|
||||
Statement stmt = (*_pSession << "SELECT Image FROM Person", into(res));
|
||||
try { stmt.execute(); }
|
||||
|
@ -42,7 +42,7 @@ endif
|
||||
|
||||
objects = Binder ConnectionHandle Connector EnvironmentHandle \
|
||||
Extractor ODBCMetaColumn ODBCException ODBCStatementImpl \
|
||||
Parameter Preparation SessionImpl TypeInfo Unicode Utility
|
||||
Parameter Preparator SessionImpl TypeInfo Unicode Utility
|
||||
|
||||
target = PocoODBC
|
||||
target_version = $(LIBVERSION)
|
||||
|
@ -250,52 +250,52 @@
|
||||
Name="Header Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Binder.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Binder.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\ConnectionHandle.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\ConnectionHandle.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Connector.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Connector.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Diagnostics.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Diagnostics.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\EnvironmentHandle.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\EnvironmentHandle.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Error.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Error.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Extractor.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Extractor.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Handle.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Handle.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\ODBC.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\ODBC.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\ODBCException.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\ODBCException.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\ODBC\ODBCMetaColumn.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\ODBCStatementImpl.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\ODBCStatementImpl.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Parameter.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Parameter.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Preparation.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Preparator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\SessionImpl.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\SessionImpl.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\TypeInfo.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\TypeInfo.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\ODBC\Unicode.h">
|
||||
@ -355,7 +355,7 @@
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\Odbc\Utility.h">
|
||||
RelativePath=".\include\Poco\Data\ODBC\Utility.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
@ -389,7 +389,7 @@
|
||||
RelativePath=".\src\Parameter.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.cpp">
|
||||
RelativePath=".\src\Preparator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\SessionImpl.cpp">
|
||||
|
@ -406,7 +406,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Poco\Data\ODBC\Preparation.h"
|
||||
RelativePath=".\include\Poco\Data\ODBC\Preparator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -474,7 +474,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.cpp"
|
||||
RelativePath=".\src\Preparator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/ODBC/Handle.h"
|
||||
#include "Poco/Data/ODBC/Parameter.h"
|
||||
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
|
||||
@ -69,7 +70,6 @@ namespace Data {
|
||||
|
||||
class Date;
|
||||
class Time;
|
||||
class BLOB;
|
||||
|
||||
|
||||
namespace ODBC {
|
||||
@ -272,6 +272,9 @@ public:
|
||||
void bind(std::size_t pos, const BLOB& val, Direction dir);
|
||||
/// Binds a BLOB. In-bound only.
|
||||
|
||||
void bind(std::size_t pos, const CLOB& val, Direction dir);
|
||||
/// Binds a CLOB. In-bound only.
|
||||
|
||||
void bind(std::size_t pos, const std::vector<BLOB>& val, Direction dir);
|
||||
/// Binds a BLOB vector.
|
||||
|
||||
@ -281,6 +284,15 @@ public:
|
||||
void bind(std::size_t pos, const std::list<BLOB>& val, Direction dir);
|
||||
/// Binds a BLOB list.
|
||||
|
||||
void bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir);
|
||||
/// Binds a CLOB vector.
|
||||
|
||||
void bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir);
|
||||
/// Binds a CLOB deque.
|
||||
|
||||
void bind(std::size_t pos, const std::list<CLOB>& val, Direction dir);
|
||||
/// Binds a CLOB list.
|
||||
|
||||
void bind(std::size_t pos, const Date& val, Direction dir);
|
||||
/// Binds a Date.
|
||||
|
||||
@ -393,6 +405,40 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
template <typename L>
|
||||
void bindImplLOB(std::size_t pos, const L& val, Direction dir)
|
||||
{
|
||||
if (isOutBound(dir) || !isInBound(dir))
|
||||
throw NotImplementedException("LOB parameter type can only be inbound.");
|
||||
|
||||
SQLPOINTER pVal = (SQLPOINTER) val.rawContent();
|
||||
SQLINTEGER size = (SQLINTEGER) val.size();
|
||||
|
||||
_inParams.insert(ParamMap::value_type(pVal, size));
|
||||
|
||||
SQLLEN* pLenIn = new SQLLEN;
|
||||
*pLenIn = size;
|
||||
|
||||
if (PB_AT_EXEC == _paramBinding)
|
||||
*pLenIn = SQL_LEN_DATA_AT_EXEC(size);
|
||||
|
||||
_lengthIndicator.push_back(pLenIn);
|
||||
|
||||
if (Utility::isError(SQLBindParameter(_rStmt,
|
||||
(SQLUSMALLINT) pos + 1,
|
||||
SQL_PARAM_INPUT,
|
||||
SQL_C_BINARY,
|
||||
SQL_LONGVARBINARY,
|
||||
(SQLUINTEGER) size,
|
||||
0,
|
||||
pVal,
|
||||
(SQLINTEGER) size,
|
||||
_lengthIndicator.back())))
|
||||
{
|
||||
throw StatementException(_rStmt, "SQLBindParameter(LOB)");
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void bindImplVec(std::size_t pos, const std::vector<T>& val, SQLSMALLINT cDataType, Direction dir)
|
||||
{
|
||||
@ -553,8 +599,11 @@ private:
|
||||
}
|
||||
|
||||
template <typename C>
|
||||
void bindImplContainerBLOB(std::size_t pos, const C& val, Direction dir)
|
||||
void bindImplContainerLOB(std::size_t pos, const C& val, Direction dir)
|
||||
{
|
||||
typedef typename C::value_type LOBType;
|
||||
typedef typename LOBType::ValueType CharType;
|
||||
|
||||
if (isOutBound(dir) || !isInBound(dir))
|
||||
throw NotImplementedException("BLOB container parameter type can only be inbound.");
|
||||
|
||||
@ -585,7 +634,7 @@ private:
|
||||
if (_charPtrs.size() <= pos)
|
||||
_charPtrs.resize(pos + 1, 0);
|
||||
|
||||
_charPtrs[pos] = (char*) std::calloc(val.size() * size, sizeof(char));
|
||||
_charPtrs[pos] = (char*) std::calloc(val.size() * size, sizeof(CharType));
|
||||
poco_check_ptr (_charPtrs[pos]);
|
||||
|
||||
std::size_t blobSize;
|
||||
@ -597,7 +646,7 @@ private:
|
||||
blobSize = cIt->size();
|
||||
if (blobSize > size)
|
||||
throw LengthExceededException("SQLBindParameter(std::vector<BLOB>)");
|
||||
std::memcpy(_charPtrs[pos] + offset, cIt->rawContent(), blobSize);
|
||||
std::memcpy(_charPtrs[pos] + offset, cIt->rawContent(), blobSize * sizeof(CharType));
|
||||
offset += size;
|
||||
}
|
||||
|
||||
@ -1203,22 +1252,51 @@ inline void Binder::bind(std::size_t pos, const std::list<std::string>& val, Dir
|
||||
bindImplContainerString(pos, val, dir);
|
||||
}
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const BLOB& val, Direction dir)
|
||||
{
|
||||
bindImplLOB<BLOB>(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const CLOB& val, Direction dir)
|
||||
{
|
||||
bindImplLOB<CLOB>(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const std::vector<BLOB>& val, Direction dir)
|
||||
{
|
||||
bindImplContainerBLOB(pos, val, dir);
|
||||
bindImplContainerLOB(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const std::deque<BLOB>& val, Direction dir)
|
||||
{
|
||||
bindImplContainerBLOB(pos, val, dir);
|
||||
bindImplContainerLOB(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const std::list<BLOB>& val, Direction dir)
|
||||
{
|
||||
bindImplContainerBLOB(pos, val, dir);
|
||||
bindImplContainerLOB(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir)
|
||||
{
|
||||
bindImplContainerLOB(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir)
|
||||
{
|
||||
bindImplContainerLOB(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const std::list<CLOB>& val, Direction dir)
|
||||
{
|
||||
bindImplContainerLOB(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "Poco/Data/Constants.h"
|
||||
#include "Poco/Data/ODBC/ODBC.h"
|
||||
#include "Poco/Data/AbstractExtractor.h"
|
||||
#include "Poco/Data/ODBC/Preparation.h"
|
||||
#include "Poco/Data/ODBC/Preparator.h"
|
||||
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
|
||||
#include "Poco/Data/ODBC/Error.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
@ -71,7 +71,7 @@ class ODBC_API Extractor: public Poco::Data::AbstractExtractor
|
||||
{
|
||||
public:
|
||||
Extractor(const StatementHandle& rStmt,
|
||||
Preparation& rPreparation);
|
||||
Preparator& rPreparator);
|
||||
/// Creates the Extractor.
|
||||
|
||||
~Extractor();
|
||||
@ -250,6 +250,9 @@ public:
|
||||
bool extract(std::size_t pos, Poco::Data::BLOB& val);
|
||||
/// Extracts a BLOB.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::CLOB& val);
|
||||
/// Extracts a CLOB.
|
||||
|
||||
bool extract(std::size_t pos, std::vector<Poco::Data::BLOB>& val);
|
||||
/// Extracts a BLOB vector.
|
||||
|
||||
@ -259,6 +262,15 @@ public:
|
||||
bool extract(std::size_t pos, std::list<Poco::Data::BLOB>& val);
|
||||
/// Extracts a BLOB list.
|
||||
|
||||
bool extract(std::size_t pos, std::vector<Poco::Data::CLOB>& val);
|
||||
/// Extracts a CLOB vector.
|
||||
|
||||
bool extract(std::size_t pos, std::deque<Poco::Data::CLOB>& val);
|
||||
/// Extracts a CLOB deque.
|
||||
|
||||
bool extract(std::size_t pos, std::list<Poco::Data::CLOB>& val);
|
||||
/// Extracts a CLOB list.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::Date& val);
|
||||
/// Extracts a Date.
|
||||
|
||||
@ -319,10 +331,10 @@ public:
|
||||
bool extract(std::size_t pos, std::list<Poco::DynamicAny>& val);
|
||||
/// Extracts a DynamicAny list.
|
||||
|
||||
void setDataExtraction(Preparation::DataExtraction ext);
|
||||
void setDataExtraction(Preparator::DataExtraction ext);
|
||||
/// Set data extraction mode.
|
||||
|
||||
Preparation::DataExtraction getDataExtraction() const;
|
||||
Preparator::DataExtraction getDataExtraction() const;
|
||||
/// Returns data extraction mode.
|
||||
|
||||
bool isNull(std::size_t col, std::size_t row = POCO_DATA_INVALID_ROW);
|
||||
@ -354,21 +366,85 @@ private:
|
||||
bool extractBoundImpl(std::size_t pos, T& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
poco_assert_dbg (typeid(T) == _rPreparation[pos].type());
|
||||
val = *AnyCast<T>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (typeid(T) == _rPreparator[pos].type());
|
||||
val = *AnyCast<T>(&_rPreparator[pos]);
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename C>
|
||||
bool extractBoundImpl(std::size_t pos, Poco::Data::BLOB& val);
|
||||
bool extractBoundImpl(std::size_t pos, Poco::Data::CLOB& val);
|
||||
|
||||
template <typename C>
|
||||
bool extractBoundImplContainer(std::size_t pos, C& val)
|
||||
{
|
||||
typedef typename C::value_type Type;
|
||||
poco_assert_dbg (typeid(std::vector<Type>) == _rPreparation[pos].type());
|
||||
std::vector<Type>& v = RefAnyCast<std::vector<Type> >(_rPreparation[pos]);
|
||||
poco_assert_dbg (typeid(std::vector<Type>) == _rPreparator[pos].type());
|
||||
std::vector<Type>& v = RefAnyCast<std::vector<Type> >(_rPreparator[pos]);
|
||||
val.assign(v.begin(), v.end());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool extractBoundImplContainer(std::size_t pos, std::vector<std::string>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::deque<std::string>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::list<std::string>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::vector<Poco::Data::CLOB>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::deque<Poco::Data::CLOB>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::list<Poco::Data::CLOB>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::vector<Poco::Data::BLOB>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::deque<Poco::Data::BLOB>& values);
|
||||
bool extractBoundImplContainer(std::size_t pos, std::list<Poco::Data::BLOB>& values);
|
||||
|
||||
template <typename C>
|
||||
bool extractBoundImplContainerString(std::size_t pos, C& values)
|
||||
{
|
||||
typedef typename C::value_type StringType;
|
||||
typedef typename C::iterator ItType;
|
||||
typedef typename StringType::value_type CharType;
|
||||
|
||||
CharType** pc = AnyCast<CharType*>(&_rPreparator[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparator.bulkSize() == values.size());
|
||||
std::size_t colWidth = columnSize(pos);
|
||||
ItType it = values.begin();
|
||||
ItType end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assign(*pc + row * colWidth, _rPreparator.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename C>
|
||||
bool extractBoundImplContainerLOB(std::size_t pos, C& values)
|
||||
{
|
||||
typedef typename C::value_type LOBType;
|
||||
typedef typename LOBType::ValueType CharType;
|
||||
typedef typename C::iterator ItType;
|
||||
|
||||
CharType** pc = AnyCast<CharType*>(&_rPreparator[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparator.bulkSize() == values.size());
|
||||
std::size_t colWidth = _rPreparator.maxDataSize(pos);
|
||||
ItType it = values.begin();
|
||||
ItType end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assignRaw(*pc + row * colWidth, _rPreparator.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool extractBoundImplLOB(std::size_t pos, Poco::Data::LOB<T>& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
|
||||
std::size_t dataSize = _rPreparator.actualDataSize(pos);
|
||||
checkDataSize(dataSize);
|
||||
T* sp = AnyCast<T*>(_rPreparator[pos]);
|
||||
val.assignRaw(sp, dataSize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool extractManualImpl(std::size_t pos, T& val, SQLSMALLINT cType)
|
||||
{
|
||||
@ -456,6 +532,9 @@ private:
|
||||
case MetaColumn::FDT_BLOB:
|
||||
{ return extAny<T, Poco::Data::BLOB>(pos, val); }
|
||||
|
||||
case MetaColumn::FDT_CLOB:
|
||||
{ return extAny<T, Poco::Data::CLOB>(pos, val); }
|
||||
|
||||
case MetaColumn::FDT_DATE:
|
||||
{ return extAny<T, Poco::Data::Date>(pos, val); }
|
||||
|
||||
@ -480,8 +559,8 @@ private:
|
||||
SQLINTEGER columnSize(std::size_t pos) const;
|
||||
|
||||
const StatementHandle& _rStmt;
|
||||
Preparation& _rPreparation;
|
||||
Preparation::DataExtraction _dataExtraction;
|
||||
Preparator& _rPreparator;
|
||||
Preparator::DataExtraction _dataExtraction;
|
||||
std::vector<SQLLEN> _lengths;
|
||||
};
|
||||
|
||||
@ -489,13 +568,86 @@ private:
|
||||
///
|
||||
/// inlines
|
||||
///
|
||||
inline void Extractor::setDataExtraction(Preparation::DataExtraction ext)
|
||||
|
||||
inline bool Extractor::extractBoundImpl(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
_rPreparation.setDataExtraction(_dataExtraction = ext);
|
||||
return extractBoundImplLOB<BLOB::ValueType>(pos, val);
|
||||
}
|
||||
|
||||
|
||||
inline Preparation::DataExtraction Extractor::getDataExtraction() const
|
||||
inline bool Extractor::extractBoundImpl(std::size_t pos, Poco::Data::CLOB& val)
|
||||
{
|
||||
return extractBoundImplLOB<CLOB::ValueType>(pos, val);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos, std::vector<std::string>& values)
|
||||
{
|
||||
return extractBoundImplContainerString(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos, std::deque<std::string>& values)
|
||||
{
|
||||
return extractBoundImplContainerString(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos, std::list<std::string>& values)
|
||||
{
|
||||
return extractBoundImplContainerString(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos,
|
||||
std::vector<Poco::Data::CLOB>& values)
|
||||
{
|
||||
return extractBoundImplContainerLOB(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos,
|
||||
std::deque<Poco::Data::CLOB>& values)
|
||||
{
|
||||
return extractBoundImplContainerLOB(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos,
|
||||
std::list<Poco::Data::CLOB>& values)
|
||||
{
|
||||
return extractBoundImplContainerLOB(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos,
|
||||
std::vector<Poco::Data::BLOB>& values)
|
||||
{
|
||||
return extractBoundImplContainerLOB(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos,
|
||||
std::deque<Poco::Data::BLOB>& values)
|
||||
{
|
||||
return extractBoundImplContainerLOB(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extractBoundImplContainer(std::size_t pos,
|
||||
std::list<Poco::Data::BLOB>& values)
|
||||
{
|
||||
return extractBoundImplContainerLOB(pos, values);
|
||||
}
|
||||
|
||||
|
||||
inline void Extractor::setDataExtraction(Preparator::DataExtraction ext)
|
||||
{
|
||||
_rPreparator.setDataExtraction(_dataExtraction = ext);
|
||||
}
|
||||
|
||||
|
||||
inline Preparator::DataExtraction Extractor::getDataExtraction() const
|
||||
{
|
||||
return _dataExtraction;
|
||||
}
|
||||
@ -523,7 +675,7 @@ inline bool Extractor::isNullLengthIndicator(SQLLEN val) const
|
||||
inline SQLINTEGER Extractor::columnSize(std::size_t pos) const
|
||||
{
|
||||
std::size_t size = ODBCMetaColumn(_rStmt, pos).length();
|
||||
std::size_t maxSize = _rPreparation.maxDataSize(pos);
|
||||
std::size_t maxSize = _rPreparator.maxDataSize(pos);
|
||||
if (size > maxSize) size = maxSize;
|
||||
return (SQLINTEGER) size;
|
||||
}
|
||||
|
@ -44,7 +44,7 @@
|
||||
#include "Poco/Data/ODBC/SessionImpl.h"
|
||||
#include "Poco/Data/ODBC/Binder.h"
|
||||
#include "Poco/Data/ODBC/Extractor.h"
|
||||
#include "Poco/Data/ODBC/Preparation.h"
|
||||
#include "Poco/Data/ODBC/Preparator.h"
|
||||
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/Column.h"
|
||||
@ -117,8 +117,8 @@ private:
|
||||
typedef Poco::Data::AbstractBindingVec Bindings;
|
||||
typedef Poco::SharedPtr<Binder> BinderPtr;
|
||||
typedef Poco::Data::AbstractExtractionVec Extractions;
|
||||
typedef Poco::SharedPtr<Preparation> PreparationPtr;
|
||||
typedef std::vector<PreparationPtr> PreparationVec;
|
||||
typedef Poco::SharedPtr<Preparator> PreparatorPtr;
|
||||
typedef std::vector<PreparatorPtr> PreparatorVec;
|
||||
typedef Poco::SharedPtr<Extractor> ExtractorPtr;
|
||||
typedef std::vector<ExtractorPtr> ExtractorVec;
|
||||
typedef std::vector<ODBCMetaColumn*> ColumnPtrVec;
|
||||
@ -160,13 +160,13 @@ private:
|
||||
|
||||
void getData();
|
||||
|
||||
void addPreparation();
|
||||
void addPreparator();
|
||||
void fillColumns();
|
||||
void checkError(SQLRETURN rc, const std::string& msg="");
|
||||
|
||||
const SQLHDBC& _rConnection;
|
||||
const StatementHandle _stmt;
|
||||
PreparationVec _preparations;
|
||||
PreparatorVec _preparations;
|
||||
BinderPtr _pBinder;
|
||||
ExtractorVec _extractors;
|
||||
bool _stepCalled;
|
||||
|
@ -1,13 +1,13 @@
|
||||
//
|
||||
// Preparation.h
|
||||
// Preparator.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/ODBC/include/Poco/Data/ODBC/Preparation.h#5 $
|
||||
// $Id: //poco/Main/Data/ODBC/include/Poco/Data/ODBC/Preparator.h#5 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: Preparation
|
||||
// Module: Preparator
|
||||
//
|
||||
// Definition of the Preparation class.
|
||||
// Definition of the Preparator class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -36,8 +36,8 @@
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_ODBC_Preparation_INCLUDED
|
||||
#define Data_ODBC_Preparation_INCLUDED
|
||||
#ifndef Data_ODBC_Preparator_INCLUDED
|
||||
#define Data_ODBC_Preparator_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Constants.h"
|
||||
@ -45,8 +45,8 @@
|
||||
#include "Poco/Data/ODBC/Handle.h"
|
||||
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Data/AbstractPreparation.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/AbstractPreparator.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/DynamicAny.h"
|
||||
#include "Poco/DateTime.h"
|
||||
@ -64,23 +64,22 @@ namespace Data {
|
||||
|
||||
class Date;
|
||||
class Time;
|
||||
class BLOB;
|
||||
|
||||
|
||||
namespace ODBC {
|
||||
|
||||
|
||||
class ODBC_API Preparation : public AbstractPreparation
|
||||
class ODBC_API Preparator : public AbstractPreparator
|
||||
/// Class used for database preparation where we first have to register all data types
|
||||
/// with respective memory output locations before extracting data.
|
||||
/// Extraction works in two-phases: first prepare is called once, then extract n-times.
|
||||
/// In ODBC, SQLBindCol/SQLFetch is the preferred method of data retrieval (SQLGetData is available,
|
||||
/// however with numerous driver implementation dependent limitations and inferior performance).
|
||||
/// In order to fit this functionality into Poco DataConnectors framework, every ODBC SQL statement
|
||||
/// instantiates its own Preparation object.
|
||||
/// instantiates its own Preparator object.
|
||||
/// This is done once per statement execution (from StatementImpl::bindImpl()).
|
||||
///
|
||||
/// Preparation object is used to :
|
||||
/// Preparator object is used to :
|
||||
///
|
||||
/// 1) Prepare SQL statement.
|
||||
/// 2) Provide and contain the memory locations where retrieved values are placed during recordset iteration.
|
||||
@ -89,7 +88,7 @@ class ODBC_API Preparation : public AbstractPreparation
|
||||
/// Notes:
|
||||
///
|
||||
/// - Value datatypes in this interface prepare() calls serve only for the purpose of type distinction.
|
||||
/// - Preparation keeps its own std::vector<Any> buffer for fetched data to be later retrieved by Extractor.
|
||||
/// - Preparator keeps its own std::vector<Any> buffer for fetched data to be later retrieved by Extractor.
|
||||
/// - prepare() methods should not be called when extraction mode is DE_MANUAL
|
||||
///
|
||||
{
|
||||
@ -107,23 +106,25 @@ public:
|
||||
DT_BOOL,
|
||||
DT_BOOL_ARRAY,
|
||||
DT_CHAR,
|
||||
DT_UCHAR,
|
||||
DT_CHAR_ARRAY,
|
||||
DT_UCHAR_ARRAY,
|
||||
DT_DATE,
|
||||
DT_TIME,
|
||||
DT_DATETIME
|
||||
};
|
||||
|
||||
Preparation(const StatementHandle& rStmt,
|
||||
Preparator(const StatementHandle& rStmt,
|
||||
const std::string& statement,
|
||||
std::size_t maxFieldSize,
|
||||
DataExtraction dataExtraction = DE_BOUND);
|
||||
/// Creates the Preparation.
|
||||
/// Creates the Preparator.
|
||||
|
||||
Preparation(const Preparation& other);
|
||||
/// Copy constructs the Preparation.
|
||||
Preparator(const Preparator& other);
|
||||
/// Copy constructs the Preparator.
|
||||
|
||||
~Preparation();
|
||||
/// Destroys the Preparation.
|
||||
~Preparator();
|
||||
/// Destroys the Preparator.
|
||||
|
||||
void prepare(std::size_t pos, Poco::Int8& val);
|
||||
/// Prepares an Int8.
|
||||
@ -307,6 +308,18 @@ public:
|
||||
void prepare(std::size_t pos, const std::list<Poco::Data::BLOB>& val);
|
||||
/// Prepares a BLOB list.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::CLOB& val);
|
||||
/// Prepares a CLOB.
|
||||
|
||||
void prepare(std::size_t pos, const std::vector<Poco::Data::CLOB>& val);
|
||||
/// Prepares a CLOB vector.
|
||||
|
||||
void prepare(std::size_t pos, const std::deque<Poco::Data::CLOB>& val);
|
||||
/// Prepares a CLOB deque.
|
||||
|
||||
void prepare(std::size_t pos, const std::list<Poco::Data::CLOB>& val);
|
||||
/// Prepares a CLOB list.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::Date& val);
|
||||
/// Prepares a Date.
|
||||
|
||||
@ -407,8 +420,8 @@ private:
|
||||
typedef std::vector<LengthVec> LengthLengthVec;
|
||||
typedef std::map<std::size_t, DataType> IndexMap;
|
||||
|
||||
Preparation();
|
||||
Preparation& operator = (const Preparation&);
|
||||
Preparator();
|
||||
Preparator& operator = (const Preparator&);
|
||||
|
||||
template <typename C>
|
||||
void prepareImpl(std::size_t pos, const C* pVal = 0)
|
||||
@ -486,15 +499,27 @@ private:
|
||||
|
||||
case MetaColumn::FDT_STRING:
|
||||
if (pVal)
|
||||
return prepareCharArray(pos, SQL_C_CHAR, maxDataSize(pos), pVal->size());
|
||||
return prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_CHAR, maxDataSize(pos), pVal->size());
|
||||
else
|
||||
return prepareVariableLen<char>(pos, SQL_C_CHAR, maxDataSize(pos), DT_CHAR);
|
||||
|
||||
case MetaColumn::FDT_BLOB:
|
||||
{
|
||||
typedef Poco::Data::BLOB::ValueType CharType;
|
||||
if (pVal)
|
||||
return prepareCharArray(pos, SQL_C_BINARY, maxDataSize(pos), pVal->size());
|
||||
return prepareCharArray<CharType, DT_UCHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), pVal->size());
|
||||
else
|
||||
return prepareVariableLen<char>(pos, SQL_C_BINARY, maxDataSize(pos), DT_CHAR);
|
||||
return prepareVariableLen<CharType>(pos, SQL_C_BINARY, maxDataSize(pos), DT_UCHAR);
|
||||
}
|
||||
|
||||
case MetaColumn::FDT_CLOB:
|
||||
{
|
||||
typedef Poco::Data::CLOB::ValueType CharType;
|
||||
if (pVal)
|
||||
return prepareCharArray<CharType, DT_CHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), pVal->size());
|
||||
else
|
||||
return prepareVariableLen<CharType>(pos, SQL_C_BINARY, maxDataSize(pos), DT_CHAR);
|
||||
}
|
||||
|
||||
case MetaColumn::FDT_DATE:
|
||||
if (pVal)
|
||||
@ -598,9 +623,32 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T, DataType DT>
|
||||
void prepareCharArray(std::size_t pos, SQLSMALLINT valueType, std::size_t size, std::size_t length)
|
||||
/// Utility function for preparation of bulk variable length character and LOB columns.
|
||||
{
|
||||
poco_assert_dbg (DE_BOUND == _dataExtraction);
|
||||
poco_assert_dbg (pos < _values.size());
|
||||
poco_assert_dbg (pos < _lengths.size());
|
||||
poco_assert_dbg (pos < _lenLengths.size());
|
||||
|
||||
void prepareCharArray(std::size_t pos, SQLSMALLINT valueType, std::size_t size, std::size_t length);
|
||||
/// Utility function for preparation of bulk variable length character and BLOB columns.
|
||||
T* pArray = (T*) std::calloc(length * size, sizeof(T));
|
||||
|
||||
_values[pos] = Any(pArray);
|
||||
_lengths[pos] = 0;
|
||||
_lenLengths[pos].resize(length);
|
||||
_varLengthArrays.insert(IndexMap::value_type(pos, DT));
|
||||
|
||||
if (Utility::isError(SQLBindCol(_rStmt,
|
||||
(SQLUSMALLINT) pos + 1,
|
||||
valueType,
|
||||
(SQLPOINTER) pArray,
|
||||
(SQLINTEGER) size,
|
||||
&_lenLengths[pos][0])))
|
||||
{
|
||||
throw StatementException(_rStmt, "SQLBindCol()");
|
||||
}
|
||||
}
|
||||
|
||||
void prepareBoolArray(std::size_t pos, SQLSMALLINT valueType, std::size_t length);
|
||||
/// Utility function for preparation of bulk bool columns.
|
||||
@ -628,489 +676,513 @@ private:
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::Int8&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::Int8&)
|
||||
{
|
||||
prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::Int8>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::Int8>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::Int8>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::Int8>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::Int8>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::Int8>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int8>(pos, SQL_C_STINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::UInt8&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::UInt8&)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt8>(pos, SQL_C_UTINYINT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::UInt8>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::UInt8>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt8>(pos, SQL_C_UTINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::UInt8>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::UInt8>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt8>(pos, SQL_C_UTINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::UInt8>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::UInt8>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt8>(pos, SQL_C_UTINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::Int16&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::Int16&)
|
||||
{
|
||||
prepareFixedSize<Poco::Int16>(pos, SQL_C_SSHORT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::Int16>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::Int16>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int16>(pos, SQL_C_SSHORT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::Int16>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::Int16>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int16>(pos, SQL_C_SSHORT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::Int16>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::Int16>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int16>(pos, SQL_C_SSHORT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::UInt16&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::UInt16&)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt16>(pos, SQL_C_USHORT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::UInt16>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::UInt16>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt16>(pos, SQL_C_USHORT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::UInt16>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::UInt16>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt16>(pos, SQL_C_USHORT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::UInt16>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::UInt16>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt16>(pos, SQL_C_USHORT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::Int32&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::Int32&)
|
||||
{
|
||||
prepareFixedSize<Poco::Int32>(pos, SQL_C_SLONG);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::Int32>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::Int32>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int32>(pos, SQL_C_SLONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::Int32>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::Int32>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int32>(pos, SQL_C_SLONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::Int32>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::Int32>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int32>(pos, SQL_C_SLONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::UInt32&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::UInt32&)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt32>(pos, SQL_C_ULONG);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::UInt32>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::UInt32>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt32>(pos, SQL_C_ULONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::UInt32>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::UInt32>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt32>(pos, SQL_C_ULONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::UInt32>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::UInt32>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt32>(pos, SQL_C_ULONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::Int64&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::Int64&)
|
||||
{
|
||||
prepareFixedSize<Poco::Int64>(pos, SQL_C_SBIGINT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::Int64>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::Int64>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int64>(pos, SQL_C_SBIGINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::Int64>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::Int64>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int64>(pos, SQL_C_SBIGINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::Int64>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::Int64>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::Int64>(pos, SQL_C_SBIGINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, Poco::UInt64&)
|
||||
inline void Preparator::prepare(std::size_t pos, Poco::UInt64&)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt64>(pos, SQL_C_UBIGINT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<Poco::UInt64>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<Poco::UInt64>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt64>(pos, SQL_C_UBIGINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<Poco::UInt64>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<Poco::UInt64>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt64>(pos, SQL_C_UBIGINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
{
|
||||
prepareFixedSize<Poco::UInt64>(pos, SQL_C_UBIGINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
inline void Preparation::prepare(std::size_t pos, long&)
|
||||
inline void Preparator::prepare(std::size_t pos, long&)
|
||||
{
|
||||
prepareFixedSize<long>(pos, SQL_C_SLONG);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<long>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<long>& val)
|
||||
{
|
||||
prepareFixedSize<long>(pos, SQL_C_SLONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<long>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<long>& val)
|
||||
{
|
||||
prepareFixedSize<long>(pos, SQL_C_SLONG, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<long>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<long>& val)
|
||||
{
|
||||
prepareFixedSize<long>(pos, SQL_C_SLONG, val.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, bool&)
|
||||
inline void Preparator::prepare(std::size_t pos, bool&)
|
||||
{
|
||||
prepareFixedSize<bool>(pos, SQL_C_BIT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<bool>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<bool>& val)
|
||||
{
|
||||
prepareBoolArray(pos, SQL_C_BIT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<bool>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<bool>& val)
|
||||
{
|
||||
prepareBoolArray(pos, SQL_C_BIT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<bool>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<bool>& val)
|
||||
{
|
||||
prepareBoolArray(pos, SQL_C_BIT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, float&)
|
||||
inline void Preparator::prepare(std::size_t pos, float&)
|
||||
{
|
||||
prepareFixedSize<float>(pos, SQL_C_FLOAT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<float>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<float>& val)
|
||||
{
|
||||
prepareFixedSize<float>(pos, SQL_C_FLOAT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<float>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<float>& val)
|
||||
{
|
||||
prepareFixedSize<float>(pos, SQL_C_FLOAT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<float>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<float>& val)
|
||||
{
|
||||
prepareFixedSize<float>(pos, SQL_C_FLOAT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, double&)
|
||||
inline void Preparator::prepare(std::size_t pos, double&)
|
||||
{
|
||||
prepareFixedSize<double>(pos, SQL_C_DOUBLE);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<double>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<double>& val)
|
||||
{
|
||||
prepareFixedSize<double>(pos, SQL_C_DOUBLE, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<double>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<double>& val)
|
||||
{
|
||||
prepareFixedSize<double>(pos, SQL_C_DOUBLE, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<double>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<double>& val)
|
||||
{
|
||||
prepareFixedSize<double>(pos, SQL_C_DOUBLE, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, char&)
|
||||
inline void Preparator::prepare(std::size_t pos, char&)
|
||||
{
|
||||
prepareFixedSize<char>(pos, SQL_C_STINYINT);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::vector<char>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::vector<char>& val)
|
||||
{
|
||||
prepareFixedSize<char>(pos, SQL_C_STINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::deque<char>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::deque<char>& val)
|
||||
{
|
||||
prepareFixedSize<char>(pos, SQL_C_STINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, std::list<char>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, std::list<char>& val)
|
||||
{
|
||||
prepareFixedSize<char>(pos, SQL_C_STINYINT, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::string&)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::string&)
|
||||
{
|
||||
prepareVariableLen<char>(pos, SQL_C_CHAR, maxDataSize(pos), DT_CHAR);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<std::string>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<std::string>& val)
|
||||
{
|
||||
prepareCharArray(pos, SQL_C_CHAR, maxDataSize(pos), val.size());
|
||||
prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_CHAR, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<std::string>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<std::string>& val)
|
||||
{
|
||||
prepareCharArray(pos, SQL_C_CHAR, maxDataSize(pos), val.size());
|
||||
prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_CHAR, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<std::string>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<std::string>& val)
|
||||
{
|
||||
prepareCharArray(pos, SQL_C_CHAR, maxDataSize(pos), val.size());
|
||||
prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_CHAR, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const Poco::Data::BLOB&)
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::Data::BLOB&)
|
||||
{
|
||||
prepareVariableLen<char>(pos, SQL_C_BINARY, maxDataSize(pos), DT_CHAR);
|
||||
prepareVariableLen<Poco::Data::BLOB::ValueType>(pos, SQL_C_BINARY, maxDataSize(pos), DT_CHAR);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<Poco::Data::BLOB>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::Data::BLOB>& val)
|
||||
{
|
||||
prepareCharArray(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
prepareCharArray<char, DT_UCHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<Poco::Data::BLOB>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::Data::BLOB>& val)
|
||||
{
|
||||
prepareCharArray(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
prepareCharArray<char, DT_UCHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<Poco::Data::BLOB>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::Data::BLOB>& val)
|
||||
{
|
||||
prepareCharArray(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
prepareCharArray<char, DT_UCHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const Poco::Data::Date&)
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::Data::CLOB&)
|
||||
{
|
||||
prepareVariableLen<Poco::Data::CLOB::ValueType>(pos, SQL_C_BINARY, maxDataSize(pos), DT_CHAR);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::Data::CLOB>& val)
|
||||
{
|
||||
prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::Data::CLOB>& val)
|
||||
{
|
||||
prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::Data::CLOB>& val)
|
||||
{
|
||||
prepareCharArray<char, DT_CHAR_ARRAY>(pos, SQL_C_BINARY, maxDataSize(pos), val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::Data::Date&)
|
||||
{
|
||||
prepareFixedSize<SQL_DATE_STRUCT>(pos, SQL_C_TYPE_DATE);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<Poco::Data::Date>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::Data::Date>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_DATE_STRUCT>(pos, SQL_C_TYPE_DATE, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<Poco::Data::Date>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::Data::Date>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_DATE_STRUCT>(pos, SQL_C_TYPE_DATE, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<Poco::Data::Date>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::Data::Date>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_DATE_STRUCT>(pos, SQL_C_TYPE_DATE, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const Poco::Data::Time&)
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::Data::Time&)
|
||||
{
|
||||
prepareFixedSize<SQL_TIME_STRUCT>(pos, SQL_C_TYPE_TIME);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<Poco::Data::Time>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::Data::Time>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_TIME_STRUCT>(pos, SQL_C_TYPE_TIME, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<Poco::Data::Time>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::Data::Time>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_TIME_STRUCT>(pos, SQL_C_TYPE_TIME, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<Poco::Data::Time>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::Data::Time>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_TIME_STRUCT>(pos, SQL_C_TYPE_TIME, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const Poco::DateTime&)
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::DateTime&)
|
||||
{
|
||||
prepareFixedSize<SQL_TIMESTAMP_STRUCT>(pos, SQL_C_TYPE_TIMESTAMP);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<Poco::DateTime>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::DateTime>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_TIMESTAMP_STRUCT>(pos, SQL_C_TYPE_TIMESTAMP, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<Poco::DateTime>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::DateTime>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_TIMESTAMP_STRUCT>(pos, SQL_C_TYPE_TIMESTAMP, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<Poco::DateTime>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::DateTime>& val)
|
||||
{
|
||||
prepareFixedSize<SQL_TIMESTAMP_STRUCT>(pos, SQL_C_TYPE_TIMESTAMP, val.size());
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const Poco::Any& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::Any& val)
|
||||
{
|
||||
prepareImpl<std::vector<Poco::Any> >(pos);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<Poco::Any>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::Any>& val)
|
||||
{
|
||||
prepareImpl<std::vector<Poco::Any> >(pos, &val);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<Poco::Any>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::Any>& val)
|
||||
{
|
||||
prepareImpl<std::deque<Poco::Any> >(pos, &val);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<Poco::Any>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::Any>& val)
|
||||
{
|
||||
prepareImpl<std::list<Poco::Any> >(pos, &val);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const Poco::DynamicAny& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const Poco::DynamicAny& val)
|
||||
{
|
||||
prepareImpl<std::vector<Poco::DynamicAny> >(pos);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::vector<Poco::DynamicAny>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::vector<Poco::DynamicAny>& val)
|
||||
{
|
||||
prepareImpl<std::vector<Poco::DynamicAny> >(pos, &val);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::deque<Poco::DynamicAny>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::deque<Poco::DynamicAny>& val)
|
||||
{
|
||||
prepareImpl<std::deque<Poco::DynamicAny> >(pos, &val);
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::prepare(std::size_t pos, const std::list<Poco::DynamicAny>& val)
|
||||
inline void Preparator::prepare(std::size_t pos, const std::list<Poco::DynamicAny>& val)
|
||||
{
|
||||
prepareImpl<std::list<Poco::DynamicAny> >(pos, &val);
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t Preparation::bulkSize(std::size_t col) const
|
||||
inline std::size_t Preparator::bulkSize(std::size_t col) const
|
||||
{
|
||||
poco_assert (col < _lenLengths.size());
|
||||
|
||||
@ -1118,31 +1190,31 @@ inline std::size_t Preparation::bulkSize(std::size_t col) const
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::setMaxFieldSize(std::size_t size)
|
||||
inline void Preparator::setMaxFieldSize(std::size_t size)
|
||||
{
|
||||
_maxFieldSize = size;
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t Preparation::getMaxFieldSize() const
|
||||
inline std::size_t Preparator::getMaxFieldSize() const
|
||||
{
|
||||
return _maxFieldSize;
|
||||
}
|
||||
|
||||
|
||||
inline void Preparation::setDataExtraction(Preparation::DataExtraction ext)
|
||||
inline void Preparator::setDataExtraction(Preparator::DataExtraction ext)
|
||||
{
|
||||
_dataExtraction = ext;
|
||||
}
|
||||
|
||||
|
||||
inline Preparation::DataExtraction Preparation::getDataExtraction() const
|
||||
inline Preparator::DataExtraction Preparator::getDataExtraction() const
|
||||
{
|
||||
return _dataExtraction;
|
||||
}
|
||||
|
||||
|
||||
inline Poco::Any& Preparation::operator [] (std::size_t pos)
|
||||
inline Poco::Any& Preparator::operator [] (std::size_t pos)
|
||||
{
|
||||
return _values.at(pos);
|
||||
}
|
||||
@ -1151,4 +1223,4 @@ inline Poco::Any& Preparation::operator [] (std::size_t pos)
|
||||
} } } // namespace Poco::Data::ODBC
|
||||
|
||||
|
||||
#endif // Data_ODBC_Preparation_INCLUDED
|
||||
#endif // Data_ODBC_Preparator_INCLUDED
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include "Poco/Data/ODBC/Binder.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/Exception.h"
|
||||
@ -147,40 +147,6 @@ void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const BLOB& val, Direction dir)
|
||||
{
|
||||
if (isOutBound(dir) || !isInBound(dir))
|
||||
throw NotImplementedException("BLOB parameter type can only be inbound.");
|
||||
|
||||
SQLPOINTER pVal = (SQLPOINTER) val.rawContent();
|
||||
SQLINTEGER size = (SQLINTEGER) val.size();
|
||||
|
||||
_inParams.insert(ParamMap::value_type(pVal, size));
|
||||
|
||||
SQLLEN* pLenIn = new SQLLEN;
|
||||
*pLenIn = size;
|
||||
|
||||
if (PB_AT_EXEC == _paramBinding)
|
||||
*pLenIn = SQL_LEN_DATA_AT_EXEC(size);
|
||||
|
||||
_lengthIndicator.push_back(pLenIn);
|
||||
|
||||
if (Utility::isError(SQLBindParameter(_rStmt,
|
||||
(SQLUSMALLINT) pos + 1,
|
||||
SQL_PARAM_INPUT,
|
||||
SQL_C_BINARY,
|
||||
SQL_LONGVARBINARY,
|
||||
(SQLUINTEGER) size,
|
||||
0,
|
||||
pVal,
|
||||
(SQLINTEGER) size,
|
||||
_lengthIndicator.back())))
|
||||
{
|
||||
throw StatementException(_rStmt, "SQLBindParameter(BLOB)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Date& val, Direction dir)
|
||||
{
|
||||
SQLINTEGER size = (SQLINTEGER) sizeof(SQL_DATE_STRUCT);
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Buffer.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
@ -55,10 +55,10 @@ const std::string Extractor::FLD_SIZE_EXCEEDED_FMT = "Specified data size (%z by
|
||||
|
||||
|
||||
Extractor::Extractor(const StatementHandle& rStmt,
|
||||
Preparation& rPreparation):
|
||||
Preparator& rPreparator):
|
||||
_rStmt(rStmt),
|
||||
_rPreparation(rPreparation),
|
||||
_dataExtraction(rPreparation.getDataExtraction())
|
||||
_rPreparator(rPreparator),
|
||||
_dataExtraction(rPreparator.getDataExtraction())
|
||||
{
|
||||
}
|
||||
|
||||
@ -73,8 +73,8 @@ bool Extractor::extractBoundImpl<std::string>(std::size_t pos, std::string& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
|
||||
std::size_t dataSize = _rPreparation.actualDataSize(pos);
|
||||
char* sp = AnyCast<char*>(_rPreparation[pos]);
|
||||
std::size_t dataSize = _rPreparator.actualDataSize(pos);
|
||||
char* sp = AnyCast<char*>(_rPreparator[pos]);
|
||||
std::size_t len = std::strlen(sp);
|
||||
if (len < dataSize) dataSize = len;
|
||||
checkDataSize(dataSize);
|
||||
@ -84,127 +84,11 @@ bool Extractor::extractBoundImpl<std::string>(std::size_t pos, std::string& val)
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImplContainer<std::vector<std::string> >(std::size_t pos,
|
||||
std::vector<std::string>& values)
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparation.bulkSize() == values.size());
|
||||
std::size_t colWidth = columnSize(pos);
|
||||
std::vector<std::string>::iterator it = values.begin();
|
||||
std::vector<std::string>::iterator end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assign(*pc + row * colWidth, _rPreparation.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImplContainer<std::deque<std::string> >(std::size_t pos,
|
||||
std::deque<std::string>& values)
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparation.bulkSize() == values.size());
|
||||
std::size_t colWidth = columnSize(pos);
|
||||
std::deque<std::string>::iterator it = values.begin();
|
||||
std::deque<std::string>::iterator end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assign(*pc + row * colWidth, _rPreparation.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImplContainer<std::list<std::string> >(std::size_t pos,
|
||||
std::list<std::string>& values)
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparation.bulkSize() == values.size());
|
||||
std::size_t colWidth = columnSize(pos);
|
||||
std::list<std::string>::iterator it = values.begin();
|
||||
std::list<std::string>::iterator end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assign(*pc + row * colWidth, _rPreparation.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImpl<Poco::Data::BLOB>(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
|
||||
std::size_t dataSize = _rPreparation.actualDataSize(pos);
|
||||
checkDataSize(dataSize);
|
||||
char* sp = AnyCast<char*>(_rPreparation[pos]);
|
||||
val.assignRaw(sp, dataSize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::BLOB> >(std::size_t pos,
|
||||
std::vector<Poco::Data::BLOB>& values)
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparation.bulkSize() == values.size());
|
||||
std::size_t colWidth = _rPreparation.maxDataSize(pos);
|
||||
std::vector<Poco::Data::BLOB>::iterator it = values.begin();
|
||||
std::vector<Poco::Data::BLOB>::iterator end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assignRaw(*pc + row * colWidth, _rPreparation.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::BLOB> >(std::size_t pos,
|
||||
std::deque<Poco::Data::BLOB>& values)
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparation.bulkSize() == values.size());
|
||||
std::size_t colWidth = _rPreparation.maxDataSize(pos);
|
||||
std::deque<Poco::Data::BLOB>::iterator it = values.begin();
|
||||
std::deque<Poco::Data::BLOB>::iterator end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assignRaw(*pc + row * colWidth, _rPreparation.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImplContainer<std::list<Poco::Data::BLOB> >(std::size_t pos,
|
||||
std::list<Poco::Data::BLOB>& values)
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_rPreparation[pos]);
|
||||
poco_assert_dbg (pc);
|
||||
poco_assert_dbg (_rPreparation.bulkSize() == values.size());
|
||||
std::size_t colWidth = _rPreparation.maxDataSize(pos);
|
||||
std::list<Poco::Data::BLOB>::iterator it = values.begin();
|
||||
std::list<Poco::Data::BLOB>::iterator end = values.end();
|
||||
for (int row = 0; it != end; ++it, ++row)
|
||||
it->assignRaw(*pc + row * colWidth, _rPreparation.actualDataSize(pos, row));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractBoundImpl<Poco::Data::Date>(std::size_t pos, Poco::Data::Date& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
SQL_DATE_STRUCT& ds = *AnyCast<SQL_DATE_STRUCT>(&_rPreparation[pos]);
|
||||
SQL_DATE_STRUCT& ds = *AnyCast<SQL_DATE_STRUCT>(&_rPreparator[pos]);
|
||||
Utility::dateSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -214,7 +98,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Date> >(std::size_t pos,
|
||||
std::vector<Poco::Data::Date>& val)
|
||||
{
|
||||
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::dateSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -224,7 +108,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Date> >(std::size_t pos,
|
||||
std::deque<Poco::Data::Date>& val)
|
||||
{
|
||||
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::dateSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -234,7 +118,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::list<Poco::Data::Date> >(std::size_t pos,
|
||||
std::list<Poco::Data::Date>& val)
|
||||
{
|
||||
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_DATE_STRUCT>& ds = RefAnyCast<std::vector<SQL_DATE_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::dateSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -245,9 +129,9 @@ bool Extractor::extractBoundImpl<Poco::Data::Time>(std::size_t pos, Poco::Data::
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
|
||||
std::size_t dataSize = _rPreparation.actualDataSize(pos);
|
||||
std::size_t dataSize = _rPreparator.actualDataSize(pos);
|
||||
checkDataSize(dataSize);
|
||||
SQL_TIME_STRUCT& ts = *AnyCast<SQL_TIME_STRUCT>(&_rPreparation[pos]);
|
||||
SQL_TIME_STRUCT& ts = *AnyCast<SQL_TIME_STRUCT>(&_rPreparator[pos]);
|
||||
Utility::timeSync(val, ts);
|
||||
|
||||
return true;
|
||||
@ -258,7 +142,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::vector<Poco::Data::Time> >(std::size_t pos,
|
||||
std::vector<Poco::Data::Time>& val)
|
||||
{
|
||||
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::timeSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -268,7 +152,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::deque<Poco::Data::Time> >(std::size_t pos,
|
||||
std::deque<Poco::Data::Time>& val)
|
||||
{
|
||||
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::timeSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -278,7 +162,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::list<Poco::Data::Time> >(std::size_t pos,
|
||||
std::list<Poco::Data::Time>& val)
|
||||
{
|
||||
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_TIME_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIME_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::timeSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -289,9 +173,9 @@ bool Extractor::extractBoundImpl<Poco::DateTime>(std::size_t pos, Poco::DateTime
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
|
||||
std::size_t dataSize = _rPreparation.actualDataSize(pos);
|
||||
std::size_t dataSize = _rPreparator.actualDataSize(pos);
|
||||
checkDataSize(dataSize);
|
||||
SQL_TIMESTAMP_STRUCT& tss = *AnyCast<SQL_TIMESTAMP_STRUCT>(&_rPreparation[pos]);
|
||||
SQL_TIMESTAMP_STRUCT& tss = *AnyCast<SQL_TIMESTAMP_STRUCT>(&_rPreparator[pos]);
|
||||
Utility::dateTimeSync(val, tss);
|
||||
|
||||
return true;
|
||||
@ -302,7 +186,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::vector<Poco::DateTime> >(std::size_t pos,
|
||||
std::vector<Poco::DateTime>& val)
|
||||
{
|
||||
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::dateTimeSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -312,7 +196,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::deque<Poco::DateTime> >(std::size_t pos,
|
||||
std::deque<Poco::DateTime>& val)
|
||||
{
|
||||
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::dateTimeSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -322,7 +206,7 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::list<Poco::DateTime> >(std::size_t pos,
|
||||
std::list<Poco::DateTime>& val)
|
||||
{
|
||||
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_rPreparation[pos]);
|
||||
std::vector<SQL_TIMESTAMP_STRUCT>& ds = RefAnyCast<std::vector<SQL_TIMESTAMP_STRUCT> >(_rPreparator[pos]);
|
||||
Utility::dateTimeSync(val, ds);
|
||||
return true;
|
||||
}
|
||||
@ -332,8 +216,8 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::vector<bool> >(std::size_t pos,
|
||||
std::vector<bool>& val)
|
||||
{
|
||||
std::size_t length = _rPreparation.getLength();
|
||||
bool** p = AnyCast<bool*>(&_rPreparation[pos]);
|
||||
std::size_t length = _rPreparator.getLength();
|
||||
bool** p = AnyCast<bool*>(&_rPreparator[pos]);
|
||||
val.assign(*p, *p + length);
|
||||
return true;
|
||||
}
|
||||
@ -343,8 +227,8 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::deque<bool> >(std::size_t pos,
|
||||
std::deque<bool>& val)
|
||||
{
|
||||
std::size_t length = _rPreparation.getLength();
|
||||
bool** p = AnyCast<bool*>(&_rPreparation[pos]);
|
||||
std::size_t length = _rPreparator.getLength();
|
||||
bool** p = AnyCast<bool*>(&_rPreparator[pos]);
|
||||
val.assign(*p, *p + length);
|
||||
return true;
|
||||
}
|
||||
@ -354,8 +238,8 @@ template<>
|
||||
bool Extractor::extractBoundImplContainer<std::list<bool> >(std::size_t pos,
|
||||
std::list<bool>& val)
|
||||
{
|
||||
std::size_t length = _rPreparation.getLength();
|
||||
bool** p = AnyCast<bool*>(&_rPreparation[pos]);
|
||||
std::size_t length = _rPreparator.getLength();
|
||||
bool** p = AnyCast<bool*>(&_rPreparator[pos]);
|
||||
val.assign(*p, *p + length);
|
||||
return true;
|
||||
}
|
||||
@ -364,7 +248,7 @@ bool Extractor::extractBoundImplContainer<std::list<bool> >(std::size_t pos,
|
||||
template<>
|
||||
bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val, SQLSMALLINT cType)
|
||||
{
|
||||
std::size_t maxSize = _rPreparation.getMaxFieldSize();
|
||||
std::size_t maxSize = _rPreparator.getMaxFieldSize();
|
||||
std::size_t fetchedSize = 0;
|
||||
std::size_t totalSize = 0;
|
||||
|
||||
@ -416,11 +300,11 @@ bool Extractor::extractManualImpl<std::string>(std::size_t pos, std::string& val
|
||||
|
||||
|
||||
template<>
|
||||
bool Extractor::extractManualImpl<Poco::Data::BLOB>(std::size_t pos,
|
||||
Poco::Data::BLOB& val,
|
||||
bool Extractor::extractManualImpl<Poco::Data::CLOB>(std::size_t pos,
|
||||
Poco::Data::CLOB& val,
|
||||
SQLSMALLINT cType)
|
||||
{
|
||||
std::size_t maxSize = _rPreparation.getMaxFieldSize();
|
||||
std::size_t maxSize = _rPreparator.getMaxFieldSize();
|
||||
std::size_t fetchedSize = 0;
|
||||
std::size_t totalSize = 0;
|
||||
|
||||
@ -553,7 +437,7 @@ bool Extractor::extractManualImpl<Poco::DateTime>(std::size_t pos,
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int32& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_SLONG);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -562,7 +446,7 @@ bool Extractor::extract(std::size_t pos, Poco::Int32& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Int32>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -571,7 +455,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Int32>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Int32>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -580,7 +464,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Int32>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Int32>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -589,7 +473,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Int32>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int64& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_SBIGINT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -598,7 +482,7 @@ bool Extractor::extract(std::size_t pos, Poco::Int64& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Int64>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -607,7 +491,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Int64>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Int64>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -616,7 +500,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Int64>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Int64>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -626,7 +510,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Int64>& val)
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
bool Extractor::extract(std::size_t pos, long& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_SLONG);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -635,7 +519,7 @@ bool Extractor::extract(std::size_t pos, long& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<long>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -644,7 +528,7 @@ bool Extractor::extract(std::size_t pos, std::vector<long>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<long>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -653,7 +537,7 @@ bool Extractor::extract(std::size_t pos, std::deque<long>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<long>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -663,7 +547,7 @@ bool Extractor::extract(std::size_t pos, std::list<long>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, double& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_DOUBLE);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -672,7 +556,7 @@ bool Extractor::extract(std::size_t pos, double& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<double>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -681,7 +565,7 @@ bool Extractor::extract(std::size_t pos, std::vector<double>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<double>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -690,7 +574,7 @@ bool Extractor::extract(std::size_t pos, std::deque<double>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<double>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -699,7 +583,7 @@ bool Extractor::extract(std::size_t pos, std::list<double>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::string& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_CHAR);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -708,7 +592,7 @@ bool Extractor::extract(std::size_t pos, std::string& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<std::string>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -717,7 +601,7 @@ bool Extractor::extract(std::size_t pos, std::vector<std::string>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<std::string>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -726,7 +610,7 @@ bool Extractor::extract(std::size_t pos, std::deque<std::string>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<std::string>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -735,7 +619,16 @@ bool Extractor::extract(std::size_t pos, std::list<std::string>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_BINARY);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
|
||||
{
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_BINARY);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -744,7 +637,7 @@ bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::BLOB>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -753,7 +646,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::BLOB>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::BLOB>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -762,7 +655,34 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::BLOB>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Data::BLOB>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::CLOB>& val)
|
||||
{
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::CLOB>& val)
|
||||
{
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Data::CLOB>& val)
|
||||
{
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -771,7 +691,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Data::BLOB>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::Date& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_TYPE_DATE);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -780,7 +700,7 @@ bool Extractor::extract(std::size_t pos, Poco::Data::Date& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::Date>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -789,7 +709,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::Date>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::Date>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -798,7 +718,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::Date>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Data::Date>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -807,7 +727,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Data::Date>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::Time& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_TYPE_TIME);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -816,7 +736,7 @@ bool Extractor::extract(std::size_t pos, Poco::Data::Time& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::Time>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -825,7 +745,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Data::Time>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::Time>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -834,7 +754,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Data::Time>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Data::Time>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -843,7 +763,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Data::Time>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::DateTime& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_TYPE_TIMESTAMP);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -852,7 +772,7 @@ bool Extractor::extract(std::size_t pos, Poco::DateTime& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::DateTime>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -861,7 +781,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::DateTime>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::DateTime>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -870,7 +790,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::DateTime>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::DateTime>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -879,7 +799,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::DateTime>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int8& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_STINYINT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -888,7 +808,7 @@ bool Extractor::extract(std::size_t pos, Poco::Int8& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Int8>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -897,7 +817,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Int8>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Int8>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -906,7 +826,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Int8>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Int8>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -915,7 +835,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Int8>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt8& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_UTINYINT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -924,7 +844,7 @@ bool Extractor::extract(std::size_t pos, Poco::UInt8& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt8>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -933,7 +853,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt8>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt8>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -942,7 +862,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt8>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::UInt8>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -951,7 +871,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::UInt8>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int16& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_SSHORT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -960,7 +880,7 @@ bool Extractor::extract(std::size_t pos, Poco::Int16& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Int16>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -969,7 +889,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Int16>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Int16>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -978,7 +898,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Int16>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Int16>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -987,7 +907,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::Int16>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt16& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_USHORT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -996,7 +916,7 @@ bool Extractor::extract(std::size_t pos, Poco::UInt16& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt16>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1005,7 +925,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt16>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt16>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1014,7 +934,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt16>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::UInt16>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1023,7 +943,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::UInt16>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt32& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_ULONG);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -1032,7 +952,7 @@ bool Extractor::extract(std::size_t pos, Poco::UInt32& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt32>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1041,7 +961,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt32>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt32>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1050,7 +970,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt32>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::UInt32>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1059,7 +979,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::UInt32>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_SBIGINT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -1068,7 +988,7 @@ bool Extractor::extract(std::size_t pos, Poco::UInt64& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt64>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1077,7 +997,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::UInt64>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt64>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1086,7 +1006,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::UInt64>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1095,7 +1015,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, bool& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_BIT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -1104,7 +1024,7 @@ bool Extractor::extract(std::size_t pos, bool& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<bool>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1113,7 +1033,7 @@ bool Extractor::extract(std::size_t pos, std::vector<bool>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<bool>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1122,7 +1042,7 @@ bool Extractor::extract(std::size_t pos, std::deque<bool>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<bool>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1131,7 +1051,7 @@ bool Extractor::extract(std::size_t pos, std::list<bool>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, float& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_FLOAT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -1140,7 +1060,7 @@ bool Extractor::extract(std::size_t pos, float& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<float>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1149,7 +1069,7 @@ bool Extractor::extract(std::size_t pos, std::vector<float>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<float>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1158,7 +1078,7 @@ bool Extractor::extract(std::size_t pos, std::deque<float>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<float>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1167,7 +1087,7 @@ bool Extractor::extract(std::size_t pos, std::list<float>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, char& val)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
return extractManualImpl(pos, val, SQL_C_STINYINT);
|
||||
else
|
||||
return extractBoundImpl(pos, val);
|
||||
@ -1176,7 +1096,7 @@ bool Extractor::extract(std::size_t pos, char& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<char>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1185,7 +1105,7 @@ bool Extractor::extract(std::size_t pos, std::vector<char>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<char>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1194,7 +1114,7 @@ bool Extractor::extract(std::size_t pos, std::deque<char>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<char>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImplContainer(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1209,7 +1129,7 @@ bool Extractor::extract(std::size_t pos, Poco::Any& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::Any>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImpl(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1218,7 +1138,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::Any>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::Any>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImpl(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1227,7 +1147,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::Any>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::Any>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImpl(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1242,7 +1162,7 @@ bool Extractor::extract(std::size_t pos, Poco::DynamicAny& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::vector<Poco::DynamicAny>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImpl(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1251,7 +1171,7 @@ bool Extractor::extract(std::size_t pos, std::vector<Poco::DynamicAny>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::deque<Poco::DynamicAny>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImpl(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1260,7 +1180,7 @@ bool Extractor::extract(std::size_t pos, std::deque<Poco::DynamicAny>& val)
|
||||
|
||||
bool Extractor::extract(std::size_t pos, std::list<Poco::DynamicAny>& val)
|
||||
{
|
||||
if (Preparation::DE_BOUND == _dataExtraction)
|
||||
if (Preparator::DE_BOUND == _dataExtraction)
|
||||
return extractBoundImpl(pos, val);
|
||||
else
|
||||
throw InvalidAccessException("Direct container extraction only allowed for bound mode.");
|
||||
@ -1269,7 +1189,7 @@ bool Extractor::extract(std::size_t pos, std::list<Poco::DynamicAny>& val)
|
||||
|
||||
bool Extractor::isNull(std::size_t col, std::size_t row)
|
||||
{
|
||||
if (Preparation::DE_MANUAL == _dataExtraction)
|
||||
if (Preparator::DE_MANUAL == _dataExtraction)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1280,13 +1200,13 @@ bool Extractor::isNull(std::size_t col, std::size_t row)
|
||||
}
|
||||
}
|
||||
else
|
||||
return SQL_NULL_DATA == _rPreparation.actualDataSize(col, row);
|
||||
return SQL_NULL_DATA == _rPreparator.actualDataSize(col, row);
|
||||
}
|
||||
|
||||
|
||||
void Extractor::checkDataSize(std::size_t size)
|
||||
{
|
||||
std::size_t maxSize = _rPreparation.getMaxFieldSize();
|
||||
std::size_t maxSize = _rPreparator.getMaxFieldSize();
|
||||
if (size > maxSize)
|
||||
throw DataException(format(FLD_SIZE_EXCEEDED_FMT, size, maxSize));
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "Poco/Data/ODBC/ConnectionHandle.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#include "Poco/Data/AbstractPrepare.h"
|
||||
#include "Poco/Data/AbstractPreparation.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
@ -92,9 +92,9 @@ void ODBCStatementImpl::compileImpl()
|
||||
_nextResponse = 0;
|
||||
|
||||
if (_preparations.size())
|
||||
PreparationVec().swap(_preparations);
|
||||
PreparatorVec().swap(_preparations);
|
||||
|
||||
addPreparation();
|
||||
addPreparator();
|
||||
|
||||
Binder::ParameterBinding bind = session().getFeature("autoBind") ?
|
||||
Binder::PB_IMMEDIATE : Binder::PB_AT_EXEC;
|
||||
@ -136,7 +136,7 @@ void ODBCStatementImpl::makeInternalExtractors()
|
||||
}
|
||||
|
||||
|
||||
void ODBCStatementImpl::addPreparation()
|
||||
void ODBCStatementImpl::addPreparator()
|
||||
{
|
||||
if (0 == _preparations.size())
|
||||
{
|
||||
@ -144,15 +144,15 @@ void ODBCStatementImpl::addPreparation()
|
||||
if (statement.empty())
|
||||
throw ODBCException("Empty statements are illegal");
|
||||
|
||||
Preparation::DataExtraction ext = session().getFeature("autoExtract") ?
|
||||
Preparation::DE_BOUND : Preparation::DE_MANUAL;
|
||||
Preparator::DataExtraction ext = session().getFeature("autoExtract") ?
|
||||
Preparator::DE_BOUND : Preparator::DE_MANUAL;
|
||||
|
||||
std::size_t maxFieldSize = AnyCast<std::size_t>(session().getProperty("maxFieldSize"));
|
||||
|
||||
_preparations.push_back(new Preparation(_stmt, statement, maxFieldSize, ext));
|
||||
_preparations.push_back(new Preparator(_stmt, statement, maxFieldSize, ext));
|
||||
}
|
||||
else
|
||||
_preparations.push_back(new Preparation(*_preparations[0]));
|
||||
_preparations.push_back(new Preparator(*_preparations[0]));
|
||||
|
||||
_extractors.push_back(new Extractor(_stmt, *_preparations.back()));
|
||||
}
|
||||
@ -180,7 +180,7 @@ void ODBCStatementImpl::doPrepare()
|
||||
|
||||
for (std::size_t pos = 0; it != itEnd; ++it)
|
||||
{
|
||||
AbstractPrepare* pAP = (*it)->createPrepareObject(_preparations[curDataSet], pos);
|
||||
AbstractPreparation* pAP = (*it)->createPreparation(_preparations[curDataSet], pos);
|
||||
pAP->prepare();
|
||||
pos += (*it)->numOfColumnsHandled();
|
||||
delete pAP;
|
||||
@ -312,7 +312,7 @@ bool ODBCStatementImpl::hasNext()
|
||||
if (SQL_NO_DATA == SQLMoreResults(_stmt))
|
||||
return false;
|
||||
|
||||
addPreparation();
|
||||
addPreparator();
|
||||
doPrepare();
|
||||
fixupExtraction();
|
||||
makeStep();
|
||||
|
@ -1,11 +1,11 @@
|
||||
//
|
||||
// Preparation.cpp
|
||||
// Preparator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/ODBC/src/Preparation.cpp#5 $
|
||||
// $Id: //poco/Main/Data/ODBC/src/Preparator.cpp#5 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: Preparation
|
||||
// Module: Preparator
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -34,7 +34,7 @@
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/Data/ODBC/Preparation.h"
|
||||
#include "Poco/Data/ODBC/Preparator.h"
|
||||
#include "Poco/Data/ODBC/ODBCMetaColumn.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
@ -47,7 +47,7 @@ namespace Data {
|
||||
namespace ODBC {
|
||||
|
||||
|
||||
Preparation::Preparation(const StatementHandle& rStmt,
|
||||
Preparator::Preparator(const StatementHandle& rStmt,
|
||||
const std::string& statement,
|
||||
std::size_t maxFieldSize,
|
||||
DataExtraction dataExtraction):
|
||||
@ -61,7 +61,7 @@ Preparation::Preparation(const StatementHandle& rStmt,
|
||||
}
|
||||
|
||||
|
||||
Preparation::Preparation(const Preparation& other):
|
||||
Preparator::Preparator(const Preparator& other):
|
||||
_rStmt(other._rStmt),
|
||||
_maxFieldSize(other._maxFieldSize),
|
||||
_dataExtraction(other._dataExtraction)
|
||||
@ -70,13 +70,13 @@ Preparation::Preparation(const Preparation& other):
|
||||
}
|
||||
|
||||
|
||||
Preparation::~Preparation()
|
||||
Preparator::~Preparator()
|
||||
{
|
||||
freeMemory();
|
||||
}
|
||||
|
||||
|
||||
void Preparation::freeMemory() const
|
||||
void Preparator::freeMemory() const
|
||||
{
|
||||
IndexMap::iterator it = _varLengthArrays.begin();
|
||||
IndexMap::iterator end = _varLengthArrays.end();
|
||||
@ -92,6 +92,10 @@ void Preparation::freeMemory() const
|
||||
deleteCachedArray<char>(it->first);
|
||||
break;
|
||||
|
||||
case DT_UCHAR:
|
||||
deleteCachedArray<unsigned char>(it->first);
|
||||
break;
|
||||
|
||||
case DT_CHAR_ARRAY:
|
||||
{
|
||||
char** pc = AnyCast<char*>(&_values[it->first]);
|
||||
@ -99,6 +103,13 @@ void Preparation::freeMemory() const
|
||||
break;
|
||||
}
|
||||
|
||||
case DT_UCHAR_ARRAY:
|
||||
{
|
||||
unsigned char** pc = AnyCast<unsigned char*>(&_values[it->first]);
|
||||
if (pc) std::free(*pc);
|
||||
break;
|
||||
}
|
||||
|
||||
case DT_BOOL_ARRAY:
|
||||
{
|
||||
bool** pb = AnyCast<bool*>(&_values[it->first]);
|
||||
@ -113,14 +124,14 @@ void Preparation::freeMemory() const
|
||||
}
|
||||
|
||||
|
||||
std::size_t Preparation::columns() const
|
||||
std::size_t Preparator::columns() const
|
||||
{
|
||||
if (_values.empty()) resize();
|
||||
return _values.size();
|
||||
}
|
||||
|
||||
|
||||
void Preparation::resize() const
|
||||
void Preparator::resize() const
|
||||
{
|
||||
SQLSMALLINT nCol = 0;
|
||||
if (!Utility::isError(SQLNumResultCols(_rStmt, &nCol)) && 0 != nCol)
|
||||
@ -137,7 +148,7 @@ void Preparation::resize() const
|
||||
}
|
||||
|
||||
|
||||
std::size_t Preparation::maxDataSize(std::size_t pos) const
|
||||
std::size_t Preparator::maxDataSize(std::size_t pos) const
|
||||
{
|
||||
poco_assert_dbg (pos < _values.size());
|
||||
|
||||
@ -160,7 +171,7 @@ std::size_t Preparation::maxDataSize(std::size_t pos) const
|
||||
}
|
||||
|
||||
|
||||
std::size_t Preparation::actualDataSize(std::size_t col, std::size_t row) const
|
||||
std::size_t Preparator::actualDataSize(std::size_t col, std::size_t row) const
|
||||
{
|
||||
SQLLEN size = (POCO_DATA_INVALID_ROW == row) ? _lengths.at(col) :
|
||||
_lenLengths.at(col).at(row);
|
||||
@ -172,33 +183,7 @@ std::size_t Preparation::actualDataSize(std::size_t col, std::size_t row) const
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepareCharArray(std::size_t pos, SQLSMALLINT valueType, std::size_t size, std::size_t length)
|
||||
{
|
||||
poco_assert_dbg (DE_BOUND == _dataExtraction);
|
||||
poco_assert_dbg (pos < _values.size());
|
||||
poco_assert_dbg (pos < _lengths.size());
|
||||
poco_assert_dbg (pos < _lenLengths.size());
|
||||
|
||||
char* pArray = (char*) std::calloc(length * size, sizeof(char));
|
||||
|
||||
_values[pos] = Any(pArray);
|
||||
_lengths[pos] = 0;
|
||||
_lenLengths[pos].resize(length);
|
||||
_varLengthArrays.insert(IndexMap::value_type(pos, DT_CHAR_ARRAY));
|
||||
|
||||
if (Utility::isError(SQLBindCol(_rStmt,
|
||||
(SQLUSMALLINT) pos + 1,
|
||||
valueType,
|
||||
(SQLPOINTER) pArray,
|
||||
(SQLINTEGER) size,
|
||||
&_lenLengths[pos][0])))
|
||||
{
|
||||
throw StatementException(_rStmt, "SQLBindCol()");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepareBoolArray(std::size_t pos, SQLSMALLINT valueType, std::size_t length)
|
||||
void Preparator::prepareBoolArray(std::size_t pos, SQLSMALLINT valueType, std::size_t length)
|
||||
{
|
||||
poco_assert_dbg (DE_BOUND == _dataExtraction);
|
||||
poco_assert_dbg (pos < _values.size());
|
@ -36,7 +36,7 @@
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Format.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/ODBC/Connector.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "Poco/DynamicAny.h"
|
||||
#include "Poco/Tuple.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/ODBC/Connector.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "Poco/Format.h"
|
||||
#include "Poco/Tuple.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/ODBC/Connector.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
|
@ -50,7 +50,7 @@ using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::DataException;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::CLOB;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
@ -237,7 +237,7 @@ void ODBCSQLServerTest::testBulk()
|
||||
recreateMiscTable();
|
||||
_pExecutor->doBulkWithBool<std::vector<int>,
|
||||
std::vector<std::string>,
|
||||
std::vector<BLOB>,
|
||||
std::vector<CLOB>,
|
||||
std::vector<double>,
|
||||
std::vector<DateTime>,
|
||||
std::vector<bool> >(100, "CONVERT(VARBINARY(30),?)");
|
||||
@ -245,7 +245,7 @@ void ODBCSQLServerTest::testBulk()
|
||||
recreateMiscTable();
|
||||
_pExecutor->doBulkWithBool<std::deque<int>,
|
||||
std::deque<std::string>,
|
||||
std::deque<BLOB>,
|
||||
std::deque<CLOB>,
|
||||
std::deque<double>,
|
||||
std::deque<DateTime>,
|
||||
std::deque<bool> >(100, "CONVERT(VARBINARY(30),?)");
|
||||
@ -253,7 +253,7 @@ void ODBCSQLServerTest::testBulk()
|
||||
recreateMiscTable();
|
||||
_pExecutor->doBulkWithBool<std::list<int>,
|
||||
std::list<std::string>,
|
||||
std::list<BLOB>,
|
||||
std::list<CLOB>,
|
||||
std::list<double>,
|
||||
std::list<DateTime>,
|
||||
std::list<bool> >(100, "CONVERT(VARBINARY(30),?)");
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Format.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/ODBC/Connector.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "Poco/Tuple.h"
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/ODBC/Connector.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::CLOB;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::ODBCException;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
@ -464,21 +464,21 @@ void ODBCTest::testBulk()
|
||||
recreateMiscTable();
|
||||
_pExecutor->doBulk<std::vector<int>,
|
||||
std::vector<std::string>,
|
||||
std::vector<BLOB>,
|
||||
std::vector<CLOB>,
|
||||
std::vector<double>,
|
||||
std::vector<DateTime> >(100);
|
||||
|
||||
recreateMiscTable();
|
||||
_pExecutor->doBulk<std::deque<int>,
|
||||
std::deque<std::string>,
|
||||
std::deque<BLOB>,
|
||||
std::deque<CLOB>,
|
||||
std::deque<double>,
|
||||
std::deque<DateTime> >(100);
|
||||
|
||||
recreateMiscTable();
|
||||
_pExecutor->doBulk<std::list<int>,
|
||||
std::list<std::string>,
|
||||
std::list<BLOB>,
|
||||
std::list<CLOB>,
|
||||
std::list<double>,
|
||||
std::list<DateTime> >(100);
|
||||
}
|
||||
@ -804,11 +804,11 @@ void ODBCTest::testBLOBContainer()
|
||||
session().setFeature("autoBind", bindValue(i));
|
||||
session().setFeature("autoExtract", bindValue(i+1));
|
||||
recreatePersonBLOBTable();
|
||||
_pExecutor->blobContainer<std::vector<std::string>, std::vector<BLOB> >(10);
|
||||
_pExecutor->blobContainer<std::vector<std::string>, std::vector<CLOB> >(10);
|
||||
recreatePersonBLOBTable();
|
||||
_pExecutor->blobContainer<std::deque<std::string>, std::deque<BLOB> >(10);
|
||||
_pExecutor->blobContainer<std::deque<std::string>, std::deque<CLOB> >(10);
|
||||
recreatePersonBLOBTable();
|
||||
_pExecutor->blobContainer<std::list<std::string>, std::list<BLOB> >(10);
|
||||
_pExecutor->blobContainer<std::list<std::string>, std::list<CLOB> >(10);
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/StatementImpl.h"
|
||||
#include "Poco/Data/RecordSet.h"
|
||||
#include "Poco/Data/RowIterator.h"
|
||||
@ -60,7 +60,7 @@
|
||||
#include "Poco/Data/ODBC/Connector.h"
|
||||
#include "Poco/Data/ODBC/Utility.h"
|
||||
#include "Poco/Data/ODBC/Diagnostics.h"
|
||||
#include "Poco/Data/ODBC/Preparation.h"
|
||||
#include "Poco/Data/ODBC/Preparator.h"
|
||||
#include "Poco/Data/ODBC/ODBCException.h"
|
||||
#include "Poco/Data/ODBC/ODBCStatementImpl.h"
|
||||
#include <sqltypes.h>
|
||||
@ -80,11 +80,11 @@ using Poco::Data::RowIterator;
|
||||
using Poco::Data::SQLChannel;
|
||||
using Poco::Data::LimitException;
|
||||
using Poco::Data::BindingException;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::CLOB;
|
||||
using Poco::Data::Date;
|
||||
using Poco::Data::Time;
|
||||
using Poco::Data::ODBC::Utility;
|
||||
using Poco::Data::ODBC::Preparation;
|
||||
using Poco::Data::ODBC::Preparator;
|
||||
using Poco::Data::ODBC::ConnectionException;
|
||||
using Poco::Data::ODBC::StatementException;
|
||||
using Poco::Data::ODBC::DataTruncatedException;
|
||||
@ -203,7 +203,7 @@ public:
|
||||
pBinder->bind(pos++, obj.age, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, Person& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPrepare)
|
||||
{
|
||||
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
@ -254,7 +254,7 @@ public:
|
||||
pBinder->bind(pos++, obj.age, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, RefCountedPerson& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, RefCountedPerson& obj, AbstractPreparator* pPrepare)
|
||||
{
|
||||
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
@ -2348,7 +2348,7 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
|
||||
std::string firstName("firstname");
|
||||
std::string address("Address");
|
||||
|
||||
BLOB img("0123456789", 10);
|
||||
CLOB img("0123456789", 10);
|
||||
int count = 0;
|
||||
try { session() << format("INSERT INTO Person VALUES (?,?,?,%s)", blobPlaceholder),
|
||||
use(lastName), use(firstName), use(address), use(img), now; }
|
||||
@ -2359,14 +2359,14 @@ void SQLExecutor::blob(int bigSize, const std::string& blobPlaceholder)
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
|
||||
assert (count == 1);
|
||||
|
||||
BLOB res;
|
||||
CLOB res;
|
||||
assert (res.size() == 0);
|
||||
try { session() << "SELECT Image FROM Person", into(res), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
|
||||
assert (res == img);
|
||||
|
||||
BLOB big;
|
||||
CLOB big;
|
||||
std::vector<char> v(bigSize, 'x');
|
||||
big.assignRaw(&v[0], v.size());
|
||||
|
||||
@ -2394,7 +2394,7 @@ void SQLExecutor::blobStmt()
|
||||
std::string lastName("lastname");
|
||||
std::string firstName("firstname");
|
||||
std::string address("Address");
|
||||
BLOB blob("0123456789", 10);
|
||||
CLOB blob("0123456789", 10);
|
||||
|
||||
int count = 0;
|
||||
Statement ins = (session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(blob));
|
||||
@ -2404,7 +2404,7 @@ void SQLExecutor::blobStmt()
|
||||
catch(StatementException& se){ std::cout << se.toString() << std::endl; fail (funct); }
|
||||
assert (count == 1);
|
||||
|
||||
BLOB res;
|
||||
CLOB res;
|
||||
poco_assert (res.size() == 0);
|
||||
Statement stmt = (session() << "SELECT Image FROM Person", into(res));
|
||||
try { stmt.execute(); }
|
||||
|
@ -89,7 +89,7 @@
|
||||
using Poco::Data::Keywords::use; \
|
||||
using Poco::Data::Keywords::bulk; \
|
||||
using Poco::Data::Keywords::limit; \
|
||||
using Poco::Data::BLOB; \
|
||||
using Poco::Data::CLOB; \
|
||||
using Poco::Data::ODBC::ConnectionException; \
|
||||
using Poco::Data::ODBC::StatementException
|
||||
|
||||
@ -241,8 +241,8 @@ public:
|
||||
assert (size - 1 == ints.back());
|
||||
assert (std::string("xyz0") == strings.front());
|
||||
assert (std::string("xyz") + number == strings.back());
|
||||
assert (BLOB("abc0") == blobs.front());
|
||||
BLOB blob("abc");
|
||||
assert (CLOB("abc0") == blobs.front());
|
||||
CLOB blob("abc");
|
||||
blob.appendRaw(number.c_str(), number.size());
|
||||
assert (blob == blobs.back());
|
||||
assert (.5 == floats.front());
|
||||
@ -294,7 +294,7 @@ public:
|
||||
assert (size - 1 == ints.back());
|
||||
assert (std::string("xyz0") == strings.front());
|
||||
assert (std::string("xyz") + number == strings.back());
|
||||
assert (BLOB("abc0") == blobs.front());
|
||||
assert (CLOB("abc0") == blobs.front());
|
||||
blob.assignRaw("abc", 3);
|
||||
blob.appendRaw(number.c_str(), number.size());
|
||||
assert (blob == blobs.back());
|
||||
@ -376,8 +376,8 @@ public:
|
||||
assert (size - 1 == ints.back());
|
||||
assert (std::string("xyz0") == strings.front());
|
||||
assert (std::string("xyz") + number == strings.back());
|
||||
assert (BLOB("abc0") == blobs.front());
|
||||
BLOB blob("abc");
|
||||
assert (CLOB("abc0") == blobs.front());
|
||||
CLOB blob("abc");
|
||||
blob.appendRaw(number.c_str(), number.size());
|
||||
assert (blob == blobs.back());
|
||||
assert (.5 == floats.front());
|
||||
@ -422,7 +422,7 @@ public:
|
||||
assert (size - 1 == ints.back());
|
||||
assert (std::string("xyz0") == strings.front());
|
||||
assert (std::string("xyz") + number == strings.back());
|
||||
assert (BLOB("abc0") == blobs.front());
|
||||
assert (CLOB("abc0") == blobs.front());
|
||||
blob.assignRaw("abc", 3);
|
||||
blob.appendRaw(number.c_str(), number.size());
|
||||
assert (blob == blobs.back());
|
||||
@ -461,7 +461,7 @@ public:
|
||||
C1 lastName(size, "lastname");
|
||||
C1 firstName(size, "firstname");
|
||||
C1 address(size, "Address");
|
||||
C2 img(size, BLOB("0123456789", 10));
|
||||
C2 img(size, CLOB("0123456789", 10));
|
||||
int count = 0;
|
||||
try { session() << "INSERT INTO PERSON VALUES (?,?,?,?)", use(lastName), use(firstName), use(address), use(img), now; }
|
||||
catch(ConnectionException& ce){ std::cout << ce.toString() << std::endl; fail (funct); }
|
||||
|
@ -42,11 +42,10 @@
|
||||
|
||||
#include "Poco/Data/SQLite/SQLite.h"
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/DynamicAny.h"
|
||||
|
||||
|
||||
struct sqlite3_stmt;
|
||||
#include "sqlite3.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -114,6 +113,9 @@ public:
|
||||
void bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir);
|
||||
/// Binds a BLOB.
|
||||
|
||||
void bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir);
|
||||
/// Binds a CLOB.
|
||||
|
||||
void bind(std::size_t pos, const Date& val, Direction dir);
|
||||
/// Binds a Date.
|
||||
|
||||
@ -131,6 +133,17 @@ private:
|
||||
/// Checks the SQLite return code and throws an appropriate exception
|
||||
/// if error has occurred.
|
||||
|
||||
template <typename T>
|
||||
void bindLOB(std::size_t pos, const Poco::Data::LOB<T>& val, Direction dir)
|
||||
{
|
||||
// convert a blob to a an unsigned char* array
|
||||
const T* pData = reinterpret_cast<const T*>(val.rawContent());
|
||||
int valSize = static_cast<int>(val.size());
|
||||
|
||||
int rc = sqlite3_bind_blob(_pStmt, static_cast<int>(pos), pData, valSize, SQLITE_STATIC); // no deep copy, do not free memory
|
||||
checkReturn(rc);
|
||||
}
|
||||
|
||||
sqlite3_stmt* _pStmt;
|
||||
};
|
||||
|
||||
@ -208,6 +221,18 @@ inline void Binder::bind(std::size_t pos, const char* const &pVal, Direction dir
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir)
|
||||
{
|
||||
bindLOB<Poco::Data::BLOB::ValueType>(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
inline void Binder::bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir)
|
||||
{
|
||||
bindLOB<Poco::Data::CLOB::ValueType>(pos, val, dir);
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::SQLite
|
||||
|
||||
|
||||
|
@ -48,13 +48,11 @@
|
||||
#include "Poco/Data/Constants.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/DynamicAny.h"
|
||||
#include "sqlite3.h"
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
|
||||
struct sqlite3_stmt;
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
namespace SQLite {
|
||||
@ -121,6 +119,9 @@ public:
|
||||
bool extract(std::size_t pos, Poco::Data::BLOB& val);
|
||||
/// Extracts a BLOB.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::CLOB& val);
|
||||
/// Extracts a CLOB.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::Date& val);
|
||||
/// Extracts a Date.
|
||||
|
||||
@ -285,6 +286,16 @@ private:
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool extractLOB(std::size_t pos, Poco::Data::LOB<T>& val)
|
||||
{
|
||||
if (isNull(pos)) return false;
|
||||
int size = sqlite3_column_bytes(_pStmt, (int) pos);
|
||||
const T* pTmp = reinterpret_cast<const T*>(sqlite3_column_blob(_pStmt, (int) pos));
|
||||
val = Poco::Data::LOB<T>(pTmp, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
sqlite3_stmt* _pStmt;
|
||||
NullIndVec _nulls;
|
||||
};
|
||||
@ -299,6 +310,18 @@ inline void Extractor::reset()
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
return extractLOB<Poco::Data::BLOB::ValueType>(pos, val);
|
||||
}
|
||||
|
||||
|
||||
inline bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
|
||||
{
|
||||
return extractLOB<Poco::Data::CLOB::ValueType>(pos, val);
|
||||
}
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::SQLite
|
||||
|
||||
|
||||
|
@ -38,11 +38,9 @@
|
||||
#include "Poco/Data/SQLite/Utility.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/DateTimeFormatter.h"
|
||||
#include "Poco/DateTimeFormat.h"
|
||||
#include "sqlite3.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@ -104,17 +102,6 @@ void Binder::bind(std::size_t pos, const std::string& val, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir)
|
||||
{
|
||||
// convert a blob to a an unsigned char* array
|
||||
const unsigned char* pData = reinterpret_cast<const unsigned char*>(val.rawContent());
|
||||
int valSize = static_cast<int>(val.size());
|
||||
|
||||
int rc = sqlite3_bind_blob(_pStmt, static_cast<int>(pos), pData, valSize, SQLITE_STATIC); // no deep copy, do not free memory
|
||||
checkReturn(rc);
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Date& val, Direction dir)
|
||||
{
|
||||
DateTime dt(val.year(), val.month(), val.day());
|
||||
|
@ -38,11 +38,10 @@
|
||||
#include "Poco/Data/SQLite/Utility.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/DataException.h"
|
||||
#include "Poco/DateTimeParser.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include "sqlite3.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@ -116,17 +115,6 @@ bool Extractor::extract(std::size_t pos, std::string& val)
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
{
|
||||
if (isNull(pos))
|
||||
return false;
|
||||
int size = sqlite3_column_bytes(_pStmt, (int) pos);
|
||||
const char* pTmp = reinterpret_cast<const char*>(sqlite3_column_blob(_pStmt, (int) pos));
|
||||
val = Poco::Data::BLOB(pTmp, size);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Int8& val)
|
||||
{
|
||||
if (isNull(pos))
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/Statement.h"
|
||||
#include "Poco/Data/RecordSet.h"
|
||||
#include "Poco/Data/SQLChannel.h"
|
||||
@ -65,7 +65,7 @@ using Poco::Data::Column;
|
||||
using Poco::Data::Row;
|
||||
using Poco::Data::SQLChannel;
|
||||
using Poco::Data::LimitException;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::CLOB;
|
||||
using Poco::Data::Date;
|
||||
using Poco::Data::Time;
|
||||
using Poco::Data::AbstractExtractionVec;
|
||||
@ -143,7 +143,7 @@ public:
|
||||
pBinder->bind(pos++, obj.age, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, Person& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, Person& obj, AbstractPreparator* pPrepare)
|
||||
{
|
||||
// the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
@ -1215,7 +1215,7 @@ void SQLiteTest::testEmptyDB()
|
||||
}
|
||||
|
||||
|
||||
void SQLiteTest::testBLOB()
|
||||
void SQLiteTest::testCLOB()
|
||||
{
|
||||
std::string lastName("lastname");
|
||||
std::string firstName("firstname");
|
||||
@ -1223,12 +1223,12 @@ void SQLiteTest::testBLOB()
|
||||
Session tmp (Poco::Data::SQLite::Connector::KEY, "dummy.db");
|
||||
tmp << "DROP TABLE IF EXISTS Person", now;
|
||||
tmp << "CREATE TABLE IF NOT EXISTS Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Image BLOB)", now;
|
||||
BLOB img("0123456789", 10);
|
||||
CLOB img("0123456789", 10);
|
||||
int count = 0;
|
||||
tmp << "INSERT INTO PERSON VALUES(:ln, :fn, :ad, :img)", use(lastName), use(firstName), use(address), use(img), now;
|
||||
tmp << "SELECT COUNT(*) FROM PERSON", into(count), now;
|
||||
assert (count == 1);
|
||||
BLOB res;
|
||||
CLOB res;
|
||||
poco_assert (res.size() == 0);
|
||||
|
||||
tmp << "SELECT Image FROM Person WHERE LastName == :ln", bind("lastname"), into(res), now;
|
||||
@ -2369,7 +2369,7 @@ CppUnit::Test* SQLiteTest::suite()
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testIllegalRange);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testSingleSelect);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testEmptyDB);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testBLOB);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testCLOB);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testTuple10);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testTupleVector10);
|
||||
CppUnit_addTest(pSuite, SQLiteTest, testTuple9);
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
void testSingleSelect();
|
||||
void testEmptyDB();
|
||||
|
||||
void testBLOB();
|
||||
void testCLOB();
|
||||
|
||||
void testTuple1();
|
||||
void testTupleVector1();
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/Dynamic/Var.h"
|
||||
@ -266,6 +266,9 @@ public:
|
||||
virtual void bind(std::size_t pos, const BLOB& val, Direction dir = PD_IN) = 0;
|
||||
/// Binds a BLOB.
|
||||
|
||||
virtual void bind(std::size_t pos, const CLOB& val, Direction dir = PD_IN) = 0;
|
||||
/// Binds a CLOB.
|
||||
|
||||
virtual void bind(std::size_t pos, const std::vector<BLOB>& val, Direction dir = PD_IN);
|
||||
/// Binds a BLOB vector.
|
||||
|
||||
@ -275,6 +278,15 @@ public:
|
||||
virtual void bind(std::size_t pos, const std::list<BLOB>& val, Direction dir = PD_IN);
|
||||
/// Binds a BLOB list.
|
||||
|
||||
virtual void bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir = PD_IN);
|
||||
/// Binds a CLOB vector.
|
||||
|
||||
virtual void bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir = PD_IN);
|
||||
/// Binds a CLOB deque.
|
||||
|
||||
virtual void bind(std::size_t pos, const std::list<CLOB>& val, Direction dir = PD_IN);
|
||||
/// Binds a CLOB list.
|
||||
|
||||
virtual void bind(std::size_t pos, const DateTime& val, Direction dir = PD_IN) = 0;
|
||||
/// Binds a DateTime.
|
||||
|
||||
|
@ -55,8 +55,8 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
class AbstractPrepare;
|
||||
class AbstractPreparation;
|
||||
class AbstractPreparator;
|
||||
|
||||
|
||||
class Data_API AbstractExtraction: public Poco::RefCountedObject
|
||||
@ -109,8 +109,8 @@ public:
|
||||
virtual bool canExtract() const;
|
||||
/// Returns true. Implementations should override it for different behavior.
|
||||
|
||||
virtual AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos) = 0;
|
||||
/// Creates a Prepare object for the extracting object
|
||||
virtual AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos) = 0;
|
||||
/// Creates a Preparation object for the extracting object
|
||||
|
||||
void setLimit(Poco::UInt32 limit);
|
||||
/// Sets the limit.
|
||||
|
@ -42,6 +42,7 @@
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/Constants.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
@ -64,7 +65,6 @@ namespace Data {
|
||||
|
||||
class Date;
|
||||
class Time;
|
||||
class BLOB;
|
||||
|
||||
|
||||
class Data_API AbstractExtractor
|
||||
@ -251,6 +251,9 @@ public:
|
||||
virtual bool extract(std::size_t pos, BLOB& val) = 0;
|
||||
/// Extracts a BLOB. Returns false if null was received.
|
||||
|
||||
virtual bool extract(std::size_t pos, CLOB& val) = 0;
|
||||
/// Extracts a CLOB. Returns false if null was received.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::vector<BLOB>& val);
|
||||
/// Extracts a BLOB vector.
|
||||
|
||||
@ -260,6 +263,15 @@ public:
|
||||
virtual bool extract(std::size_t pos, std::list<BLOB>& val);
|
||||
/// Extracts a BLOB list.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::vector<CLOB>& val);
|
||||
/// Extracts a CLOB vector.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::deque<CLOB>& val);
|
||||
/// Extracts a CLOB deque.
|
||||
|
||||
virtual bool extract(std::size_t pos, std::list<CLOB>& val);
|
||||
/// Extracts a CLOB list.
|
||||
|
||||
virtual bool extract(std::size_t pos, DateTime& val) = 0;
|
||||
/// Extracts a DateTime. Returns false if null was received.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// AbstractPreparation.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/AbstractPreparation.h#5 $
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/AbstractPreparation.h#4 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
@ -41,335 +41,43 @@
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
class DateTime;
|
||||
class Any;
|
||||
|
||||
namespace Dynamic {
|
||||
class Var;
|
||||
}
|
||||
|
||||
|
||||
namespace Data {
|
||||
|
||||
|
||||
class Date;
|
||||
class Time;
|
||||
class BLOB;
|
||||
class AbstractPreparator;
|
||||
|
||||
|
||||
class Data_API AbstractPreparation: public Poco::RefCountedObject
|
||||
/// Interface used for database preparation where we first have to register all data types (and memory output locations)
|
||||
/// before extracting data, i.e. extract works as two-pase extract: first we call prepare once, then extract n-times.
|
||||
/// There are cases (bulk operations using std::vector storage) when extract is called only once.
|
||||
/// The value passed to a prepare() call is not be used by the prepare, serving only as an indication of the data type
|
||||
/// being prepared.
|
||||
/// Implementing this interface is not mandatory for a connector. Connectors that only extract data after SQL execution
|
||||
/// (e.g. SQLite) do not need this functionality at all.
|
||||
class Data_API AbstractPreparation
|
||||
/// Interface for calling the appropriate AbstractPreparator method
|
||||
{
|
||||
public:
|
||||
AbstractPreparation(Poco::UInt32 length = 1u);
|
||||
AbstractPreparation(AbstractPreparator* pPreparator);
|
||||
/// Creates the AbstractPreparation.
|
||||
|
||||
virtual ~AbstractPreparation();
|
||||
/// Destroys the AbstractPreparation.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int8&) = 0;
|
||||
/// Prepares an Int8.
|
||||
virtual void prepare() = 0;
|
||||
/// Preparations data.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int8>& val);
|
||||
/// Prepares an Int8 vector.
|
||||
protected:
|
||||
AbstractPreparator* preparation();
|
||||
/// Returns the preparation object
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int8>& val);
|
||||
/// Prepares an Int8 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int8>& val);
|
||||
/// Prepares an Int8 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt8&) = 0;
|
||||
/// Prepares an UInt8.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt8>& val);
|
||||
/// Prepares an UInt8 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt8>& val);
|
||||
/// Prepares an UInt8 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt8>& val);
|
||||
/// Prepares an UInt8 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int16&) = 0;
|
||||
/// Prepares an Int16.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int16>& val);
|
||||
/// Prepares an Int16 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int16>& val);
|
||||
/// Prepares an Int16 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int16>& val);
|
||||
/// Prepares an Int16 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt16&) = 0;
|
||||
/// Prepares an UInt16.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt16>& val);
|
||||
/// Prepares an UInt16 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt16>& val);
|
||||
/// Prepares an UInt16 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt16>& val);
|
||||
/// Prepares an UInt16 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int32&) = 0;
|
||||
/// Prepares an Int32.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int32>& val);
|
||||
/// Prepares an Int32 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int32>& val);
|
||||
/// Prepares an Int32 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int32>& val);
|
||||
/// Prepares an Int32 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt32&) = 0;
|
||||
/// Prepares an UInt32.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt32>& val);
|
||||
/// Prepares an UInt32 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt32>& val);
|
||||
/// Prepares an UInt32 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt32>& val);
|
||||
/// Prepares an UInt32 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int64&) = 0;
|
||||
/// Prepares an Int64.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int64>& val);
|
||||
/// Prepares an Int64 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int64>& val);
|
||||
/// Prepares an Int64 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int64>& val);
|
||||
/// Prepares an Int64 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt64&) = 0;
|
||||
/// Prepares an UInt64.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt64>& val);
|
||||
/// Prepares an UInt64 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt64>& val);
|
||||
/// Prepares an UInt64 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt64>& val);
|
||||
/// Prepares an UInt64 list.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual void prepare(std::size_t pos, long&) = 0;
|
||||
/// Prepares a long.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<long>& val);
|
||||
/// Prepares a long vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<long>& val);
|
||||
/// Prepares a long deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<long>& val);
|
||||
/// Prepares a long list.
|
||||
#endif
|
||||
|
||||
virtual void prepare(std::size_t pos, bool&) = 0;
|
||||
/// Prepares a boolean.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<bool>& val);
|
||||
/// Prepares a boolean vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<bool>& val);
|
||||
/// Prepares a boolean deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<bool>& val);
|
||||
/// Prepares a boolean list.
|
||||
|
||||
virtual void prepare(std::size_t pos, float&) = 0;
|
||||
/// Prepares a float.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<float>& val);
|
||||
/// Prepares a float vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<float>& val);
|
||||
/// Prepares a float deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<float>& val);
|
||||
/// Prepares a float list.
|
||||
|
||||
virtual void prepare(std::size_t pos, double&) = 0;
|
||||
/// Prepares a double.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<double>& val);
|
||||
/// Prepares a double vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<double>& val);
|
||||
/// Prepares a double deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<double>& val);
|
||||
/// Prepares a double list.
|
||||
|
||||
virtual void prepare(std::size_t pos, char&) = 0;
|
||||
/// Prepares a single character.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<char>& val);
|
||||
/// Prepares a character vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<char>& val);
|
||||
/// Prepares a character deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<char>& val);
|
||||
/// Prepares a character list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::string&) = 0;
|
||||
/// Prepares a string.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<std::string>& val);
|
||||
/// Prepares a string vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<std::string>& val);
|
||||
/// Prepares a string deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<std::string>& val);
|
||||
/// Prepares a string list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const BLOB&) = 0;
|
||||
/// Prepares a BLOB.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<BLOB>& val);
|
||||
/// Prepares a BLOB vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<BLOB>& val);
|
||||
/// Prepares a BLOB deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<BLOB>& val);
|
||||
/// Prepares a BLOB list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const DateTime&) = 0;
|
||||
/// Prepares a DateTime.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<DateTime>& val);
|
||||
/// Prepares a DateTime vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<DateTime>& val);
|
||||
/// Prepares a DateTime deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<DateTime>& val);
|
||||
/// Prepares a DateTime list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Date&) = 0;
|
||||
/// Prepares a Date.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Date>& val);
|
||||
/// Prepares a Date vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Date>& val);
|
||||
/// Prepares a Date deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Date>& val);
|
||||
/// Prepares a Date list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Time&) = 0;
|
||||
/// Prepares a Time.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Time>& val);
|
||||
/// Prepares a Time vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Time>& val);
|
||||
/// Prepares a Time deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Time>& val);
|
||||
/// Prepares a Time list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Any&) = 0;
|
||||
/// Prepares an Any.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Any>& val);
|
||||
/// Prepares an Any vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Any>& val);
|
||||
/// Prepares an Any deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Any>& val);
|
||||
/// Prepares an Any list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Poco::Dynamic::Var&) = 0;
|
||||
/// Prepares a Var.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Poco::Dynamic::Var>& val);
|
||||
/// Prepares a Var vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Poco::Dynamic::Var>& val);
|
||||
/// Prepares a Var deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Poco::Dynamic::Var>& val);
|
||||
/// Prepares a Var list.
|
||||
|
||||
void setLength(Poco::UInt32 length);
|
||||
/// Sets the length of prepared data.
|
||||
/// Needed only for data lengths greater than 1 (i.e. for
|
||||
/// bulk operations).
|
||||
|
||||
Poco::UInt32 getLength() const;
|
||||
/// Returns the length of prepared data. Defaults to 1.
|
||||
/// The length is greater than one for bulk operations.
|
||||
|
||||
void setBulk(bool bulkPrep = true);
|
||||
/// Sets bulk operation flag (always false at object creation time)
|
||||
|
||||
bool isBulk() const;
|
||||
/// Returns bulk operation flag.
|
||||
|
||||
private:
|
||||
Poco::UInt32 _length;
|
||||
bool _bulk;
|
||||
AbstractPreparator* _pPreparator;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
/// inlines
|
||||
///
|
||||
inline void AbstractPreparation::setLength(Poco::UInt32 length)
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline AbstractPreparator* AbstractPreparation::preparation()
|
||||
{
|
||||
_length = length;
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 AbstractPreparation::getLength() const
|
||||
{
|
||||
return _length;
|
||||
}
|
||||
|
||||
|
||||
inline void AbstractPreparation::setBulk(bool bulkPrep)
|
||||
{
|
||||
_bulk = bulkPrep;
|
||||
}
|
||||
|
||||
|
||||
inline bool AbstractPreparation::isBulk() const
|
||||
{
|
||||
return _bulk;
|
||||
return _pPreparator;
|
||||
}
|
||||
|
||||
|
||||
|
391
Data/include/Poco/Data/AbstractPreparator.h
Normal file
391
Data/include/Poco/Data/AbstractPreparator.h
Normal file
@ -0,0 +1,391 @@
|
||||
//
|
||||
// AbstractPreparator.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/AbstractPreparator.h#5 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: AbstractPreparator
|
||||
//
|
||||
// Definition of the AbstractPreparator class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_AbstractPreparator_INCLUDED
|
||||
#define Data_AbstractPreparator_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/RefCountedObject.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <list>
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
|
||||
|
||||
class DateTime;
|
||||
class Any;
|
||||
|
||||
namespace Dynamic {
|
||||
class Var;
|
||||
}
|
||||
|
||||
|
||||
namespace Data {
|
||||
|
||||
|
||||
class Date;
|
||||
class Time;
|
||||
|
||||
|
||||
class Data_API AbstractPreparator: public Poco::RefCountedObject
|
||||
/// Interface used for database preparation where we first have to register all data types (and memory output locations)
|
||||
/// before extracting data, i.e. extract works as two-pase extract: first we call prepare once, then extract n-times.
|
||||
/// There are cases (bulk operations using std::vector storage) when extract is called only once.
|
||||
/// The value passed to a prepare() call is not be used by the prepare, serving only as an indication of the data type
|
||||
/// being prepared.
|
||||
/// Implementing this interface is not mandatory for a connector. Connectors that only extract data after SQL execution
|
||||
/// (e.g. SQLite) do not need this functionality at all.
|
||||
{
|
||||
public:
|
||||
AbstractPreparator(Poco::UInt32 length = 1u);
|
||||
/// Creates the AbstractPreparator.
|
||||
|
||||
virtual ~AbstractPreparator();
|
||||
/// Destroys the AbstractPreparator.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int8&) = 0;
|
||||
/// Preparations an Int8.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int8>& val);
|
||||
/// Preparations an Int8 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int8>& val);
|
||||
/// Preparations an Int8 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int8>& val);
|
||||
/// Preparations an Int8 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt8&) = 0;
|
||||
/// Preparations an UInt8.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt8>& val);
|
||||
/// Preparations an UInt8 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt8>& val);
|
||||
/// Preparations an UInt8 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt8>& val);
|
||||
/// Preparations an UInt8 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int16&) = 0;
|
||||
/// Preparations an Int16.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int16>& val);
|
||||
/// Preparations an Int16 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int16>& val);
|
||||
/// Preparations an Int16 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int16>& val);
|
||||
/// Preparations an Int16 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt16&) = 0;
|
||||
/// Preparations an UInt16.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt16>& val);
|
||||
/// Preparations an UInt16 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt16>& val);
|
||||
/// Preparations an UInt16 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt16>& val);
|
||||
/// Preparations an UInt16 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int32&) = 0;
|
||||
/// Preparations an Int32.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int32>& val);
|
||||
/// Preparations an Int32 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int32>& val);
|
||||
/// Preparations an Int32 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int32>& val);
|
||||
/// Preparations an Int32 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt32&) = 0;
|
||||
/// Preparations an UInt32.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt32>& val);
|
||||
/// Preparations an UInt32 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt32>& val);
|
||||
/// Preparations an UInt32 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt32>& val);
|
||||
/// Preparations an UInt32 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::Int64&) = 0;
|
||||
/// Preparations an Int64.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::Int64>& val);
|
||||
/// Preparations an Int64 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::Int64>& val);
|
||||
/// Preparations an Int64 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::Int64>& val);
|
||||
/// Preparations an Int64 list.
|
||||
|
||||
virtual void prepare(std::size_t pos, Poco::UInt64&) = 0;
|
||||
/// Preparations an UInt64.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<Poco::UInt64>& val);
|
||||
/// Preparations an UInt64 vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<Poco::UInt64>& val);
|
||||
/// Preparations an UInt64 deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<Poco::UInt64>& val);
|
||||
/// Preparations an UInt64 list.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
virtual void prepare(std::size_t pos, long&) = 0;
|
||||
/// Preparations a long.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<long>& val);
|
||||
/// Preparations a long vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<long>& val);
|
||||
/// Preparations a long deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<long>& val);
|
||||
/// Preparations a long list.
|
||||
#endif
|
||||
|
||||
virtual void prepare(std::size_t pos, bool&) = 0;
|
||||
/// Preparations a boolean.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<bool>& val);
|
||||
/// Preparations a boolean vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<bool>& val);
|
||||
/// Preparations a boolean deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<bool>& val);
|
||||
/// Preparations a boolean list.
|
||||
|
||||
virtual void prepare(std::size_t pos, float&) = 0;
|
||||
/// Preparations a float.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<float>& val);
|
||||
/// Preparations a float vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<float>& val);
|
||||
/// Preparations a float deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<float>& val);
|
||||
/// Preparations a float list.
|
||||
|
||||
virtual void prepare(std::size_t pos, double&) = 0;
|
||||
/// Preparations a double.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<double>& val);
|
||||
/// Preparations a double vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<double>& val);
|
||||
/// Preparations a double deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<double>& val);
|
||||
/// Preparations a double list.
|
||||
|
||||
virtual void prepare(std::size_t pos, char&) = 0;
|
||||
/// Preparations a single character.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::vector<char>& val);
|
||||
/// Preparations a character vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::deque<char>& val);
|
||||
/// Preparations a character deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, std::list<char>& val);
|
||||
/// Preparations a character list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::string&) = 0;
|
||||
/// Preparations a string.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<std::string>& val);
|
||||
/// Preparations a string vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<std::string>& val);
|
||||
/// Preparations a string deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<std::string>& val);
|
||||
/// Preparations a string list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const BLOB&) = 0;
|
||||
/// Preparations a BLOB.
|
||||
|
||||
virtual void prepare(std::size_t pos, const CLOB&) = 0;
|
||||
/// Preparations a CLOB.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<BLOB>& val);
|
||||
/// Preparations a BLOB vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<BLOB>& val);
|
||||
/// Preparations a BLOB deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<BLOB>& val);
|
||||
/// Preparations a BLOB list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<CLOB>& val);
|
||||
/// Preparations a CLOB vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<CLOB>& val);
|
||||
/// Preparations a CLOB deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<CLOB>& val);
|
||||
/// Preparations a CLOB list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const DateTime&) = 0;
|
||||
/// Preparations a DateTime.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<DateTime>& val);
|
||||
/// Preparations a DateTime vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<DateTime>& val);
|
||||
/// Preparations a DateTime deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<DateTime>& val);
|
||||
/// Preparations a DateTime list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Date&) = 0;
|
||||
/// Preparations a Date.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Date>& val);
|
||||
/// Preparations a Date vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Date>& val);
|
||||
/// Preparations a Date deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Date>& val);
|
||||
/// Preparations a Date list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Time&) = 0;
|
||||
/// Preparations a Time.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Time>& val);
|
||||
/// Preparations a Time vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Time>& val);
|
||||
/// Preparations a Time deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Time>& val);
|
||||
/// Preparations a Time list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Any&) = 0;
|
||||
/// Preparations an Any.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Any>& val);
|
||||
/// Preparations an Any vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Any>& val);
|
||||
/// Preparations an Any deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Any>& val);
|
||||
/// Preparations an Any list.
|
||||
|
||||
virtual void prepare(std::size_t pos, const Poco::Dynamic::Var&) = 0;
|
||||
/// Preparations a Var.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::vector<Poco::Dynamic::Var>& val);
|
||||
/// Preparations a Var vector.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::deque<Poco::Dynamic::Var>& val);
|
||||
/// Preparations a Var deque.
|
||||
|
||||
virtual void prepare(std::size_t pos, const std::list<Poco::Dynamic::Var>& val);
|
||||
/// Preparations a Var list.
|
||||
|
||||
void setLength(Poco::UInt32 length);
|
||||
/// Sets the length of prepared data.
|
||||
/// Needed only for data lengths greater than 1 (i.e. for
|
||||
/// bulk operations).
|
||||
|
||||
Poco::UInt32 getLength() const;
|
||||
/// Returns the length of prepared data. Defaults to 1.
|
||||
/// The length is greater than one for bulk operations.
|
||||
|
||||
void setBulk(bool bulkPrep = true);
|
||||
/// Sets bulk operation flag (always false at object creation time)
|
||||
|
||||
bool isBulk() const;
|
||||
/// Returns bulk operation flag.
|
||||
|
||||
private:
|
||||
Poco::UInt32 _length;
|
||||
bool _bulk;
|
||||
};
|
||||
|
||||
|
||||
///
|
||||
/// inlines
|
||||
///
|
||||
inline void AbstractPreparator::setLength(Poco::UInt32 length)
|
||||
{
|
||||
_length = length;
|
||||
}
|
||||
|
||||
|
||||
inline Poco::UInt32 AbstractPreparator::getLength() const
|
||||
{
|
||||
return _length;
|
||||
}
|
||||
|
||||
|
||||
inline void AbstractPreparator::setBulk(bool bulkPrep)
|
||||
{
|
||||
_bulk = bulkPrep;
|
||||
}
|
||||
|
||||
|
||||
inline bool AbstractPreparator::isBulk() const
|
||||
{
|
||||
return _bulk;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
#endif // Data_AbstractPreparator_INCLUDED
|
@ -1,87 +0,0 @@
|
||||
//
|
||||
// AbstractPrepare.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/AbstractPrepare.h#4 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: AbstractPrepare
|
||||
//
|
||||
// Definition of the AbstractPrepare class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_AbstractPrepare_INCLUDED
|
||||
#define Data_AbstractPrepare_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
class AbstractPreparation;
|
||||
|
||||
|
||||
class Data_API AbstractPrepare
|
||||
/// Interface for calling the appropriate AbstractPreparation method
|
||||
{
|
||||
public:
|
||||
AbstractPrepare(AbstractPreparation* pPrepare);
|
||||
/// Creates the AbstractPrepare.
|
||||
|
||||
virtual ~AbstractPrepare();
|
||||
/// Destroys the AbstractPrepare.
|
||||
|
||||
virtual void prepare() = 0;
|
||||
/// Prepares data.
|
||||
|
||||
protected:
|
||||
AbstractPreparation* preparation();
|
||||
/// Returns the preparation object
|
||||
|
||||
AbstractPreparation* _pPrepare;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline AbstractPreparation* AbstractPrepare::preparation()
|
||||
{
|
||||
return _pPrepare;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
#endif // Data_AbstractPrepare_INCLUDED
|
@ -1,284 +0,0 @@
|
||||
//
|
||||
// BLOB.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/BLOB.h#12 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: BLOB
|
||||
//
|
||||
// Definition of the BLOB class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_BLOB_INCLUDED
|
||||
#define Data_BLOB_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/Dynamic/VarHolder.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
class Data_API BLOB
|
||||
/// Representation of a Binary Large OBject.
|
||||
///
|
||||
/// A BLOB can hold arbitrary binary data.
|
||||
/// The maximum size depends on the underlying database.
|
||||
///
|
||||
/// The BLOBInputStream and BLOBOutputStream classes provide
|
||||
/// a convenient way to access the data in a BLOB.
|
||||
{
|
||||
public:
|
||||
typedef std::vector<char>::const_iterator Iterator;
|
||||
|
||||
BLOB();
|
||||
/// Creates an empty BLOB.
|
||||
|
||||
BLOB(const std::vector<char>& content);
|
||||
/// Creates the BLOB, content is deep-copied.
|
||||
|
||||
BLOB(const char* const pContent, std::size_t size);
|
||||
/// Creates the BLOB by deep-copying pContent.
|
||||
|
||||
BLOB(const std::string& content);
|
||||
/// Creates a BLOB from a string.
|
||||
|
||||
BLOB(const BLOB& other);
|
||||
/// Creates a BLOB by copying another one.
|
||||
|
||||
~BLOB();
|
||||
/// Destroys the BLOB.
|
||||
|
||||
BLOB& operator = (const BLOB& other);
|
||||
/// Assignment operator.
|
||||
|
||||
bool operator == (const BLOB& other) const;
|
||||
/// Compares for equality BLOB by value.
|
||||
|
||||
bool operator != (const BLOB& other) const;
|
||||
/// Compares for inequality BLOB by value.
|
||||
|
||||
void swap(BLOB& other);
|
||||
/// Swaps the BLOB with another one.
|
||||
|
||||
const std::vector<char>& content() const;
|
||||
/// Returns the content.
|
||||
|
||||
const char* rawContent() const;
|
||||
/// Returns the raw content.
|
||||
///
|
||||
/// If the BLOB is empty, returns NULL.
|
||||
|
||||
void assignRaw(const char* pChar, std::size_t count);
|
||||
/// Assigns raw content to internal storage.
|
||||
|
||||
void appendRaw(const char* pChar, std::size_t count);
|
||||
/// Assigns raw content to internal storage.
|
||||
|
||||
void clear(bool doCompact = false);
|
||||
/// Clears the content of the blob.
|
||||
/// If doCompact is true, trims the excess capacity.
|
||||
|
||||
void compact();
|
||||
/// Trims the internal storage excess capacity.
|
||||
|
||||
Iterator begin() const;
|
||||
Iterator end() const;
|
||||
|
||||
std::size_t size() const;
|
||||
/// Returns the size of the BLOB in bytes.
|
||||
|
||||
private:
|
||||
Poco::SharedPtr<std::vector<char> > _pContent;
|
||||
|
||||
friend class BLOBStreamBuf;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// inlines
|
||||
//
|
||||
inline const std::vector<char>& BLOB::content() const
|
||||
{
|
||||
return *_pContent;
|
||||
}
|
||||
|
||||
|
||||
inline const char* BLOB::rawContent() const
|
||||
{
|
||||
if (_pContent->empty())
|
||||
return 0;
|
||||
else
|
||||
return &(*_pContent)[0];
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t BLOB::size() const
|
||||
{
|
||||
return _pContent->size();
|
||||
}
|
||||
|
||||
|
||||
inline bool BLOB::operator == (const BLOB& other) const
|
||||
{
|
||||
return *_pContent == *other._pContent;
|
||||
}
|
||||
|
||||
|
||||
inline bool BLOB::operator != (const BLOB& other) const
|
||||
{
|
||||
return *_pContent != *other._pContent;
|
||||
}
|
||||
|
||||
|
||||
inline BLOB::Iterator BLOB::begin() const
|
||||
{
|
||||
return _pContent->begin();
|
||||
}
|
||||
|
||||
|
||||
inline BLOB::Iterator BLOB::end() const
|
||||
{
|
||||
return _pContent->end();
|
||||
}
|
||||
|
||||
|
||||
inline void BLOB::assignRaw(const char* pChar, std::size_t count)
|
||||
{
|
||||
poco_assert_dbg (pChar);
|
||||
BLOB tmp(pChar, count);
|
||||
swap(tmp);
|
||||
}
|
||||
|
||||
|
||||
inline void BLOB::appendRaw(const char* pChar, std::size_t count)
|
||||
{
|
||||
poco_assert_dbg (pChar);
|
||||
_pContent->insert(_pContent->end(), pChar, pChar+count);
|
||||
}
|
||||
|
||||
|
||||
inline void BLOB::swap(BLOB& other)
|
||||
{
|
||||
using std::swap;
|
||||
swap(_pContent, other._pContent);
|
||||
}
|
||||
|
||||
|
||||
inline void BLOB::clear(bool doCompact)
|
||||
{
|
||||
_pContent->clear();
|
||||
if (doCompact) compact();
|
||||
}
|
||||
|
||||
|
||||
inline void BLOB::compact()
|
||||
{
|
||||
std::vector<char>(*_pContent).swap(*_pContent);
|
||||
}
|
||||
|
||||
|
||||
inline void swap(BLOB& b1, BLOB& b2)
|
||||
{
|
||||
b1.swap(b2);
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
inline void swap<Poco::Data::BLOB>(Poco::Data::BLOB& b1,
|
||||
Poco::Data::BLOB& b2)
|
||||
/// Full template specalization of std:::swap for BLOB
|
||||
{
|
||||
b1.swap(b2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// VarHolderImpl<BLOB>
|
||||
//
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Dynamic {
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<Poco::Data::BLOB>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const Poco::Data::BLOB& val): _val(val)
|
||||
{
|
||||
}
|
||||
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(Poco::Data::BLOB);
|
||||
}
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val.assign(_val.begin(), _val.end());
|
||||
}
|
||||
|
||||
VarHolder* clone() const
|
||||
{
|
||||
return new VarHolderImpl(_val);
|
||||
}
|
||||
|
||||
const Poco::Data::BLOB& value() const
|
||||
{
|
||||
return _val;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
Poco::Data::BLOB _val;
|
||||
};
|
||||
|
||||
|
||||
} } // namespace Poco::Dynamic
|
||||
|
||||
|
||||
#endif // Data_BLOB_INCLUDED
|
@ -1,123 +0,0 @@
|
||||
//
|
||||
// BLOBStream.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/BLOBStream.h#3 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: BLOBStream
|
||||
//
|
||||
// Definition of the BLOBStream class.
|
||||
//
|
||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_BLOBStream_INCLUDED
|
||||
#define Data_BLOBStream_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include "Poco/UnbufferedStreamBuf.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include <istream>
|
||||
#include <ostream>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
class Data_API BLOBStreamBuf: public UnbufferedStreamBuf
|
||||
/// This is the streambuf class used for reading from and writing to a BLOB.
|
||||
{
|
||||
public:
|
||||
BLOBStreamBuf(BLOB& blob);
|
||||
/// Creates BLOBStreamBuf.
|
||||
|
||||
~BLOBStreamBuf();
|
||||
/// Destroys BLOBStreamBuf.
|
||||
|
||||
protected:
|
||||
int_type readFromDevice();
|
||||
int_type writeToDevice(char c);
|
||||
|
||||
private:
|
||||
BLOB& _blob;
|
||||
BLOB::Iterator _it;
|
||||
};
|
||||
|
||||
|
||||
class Data_API BLOBIOS: public virtual std::ios
|
||||
/// The base class for BLOBInputStream and
|
||||
/// BLOBOutputStream.
|
||||
///
|
||||
/// This class is needed to ensure the correct initialization
|
||||
/// order of the stream buffer and base classes.
|
||||
{
|
||||
public:
|
||||
BLOBIOS(BLOB& blob, openmode mode);
|
||||
/// Creates the BLOBIOS with the given BLOB.
|
||||
|
||||
~BLOBIOS();
|
||||
/// Destroys the BLOBIOS.
|
||||
|
||||
BLOBStreamBuf* rdbuf();
|
||||
/// Returns a pointer to the internal BLOBStreamBuf.
|
||||
|
||||
protected:
|
||||
BLOBStreamBuf _buf;
|
||||
};
|
||||
|
||||
|
||||
class Data_API BLOBOutputStream: public BLOBIOS, public std::ostream
|
||||
/// An output stream for writing to a BLOB.
|
||||
{
|
||||
public:
|
||||
BLOBOutputStream(BLOB& blob);
|
||||
/// Creates the BLOBOutputStream with the given BLOB.
|
||||
|
||||
~BLOBOutputStream();
|
||||
/// Destroys the BLOBOutputStream.
|
||||
};
|
||||
|
||||
|
||||
class Data_API BLOBInputStream: public BLOBIOS, public std::istream
|
||||
/// An input stream for reading from a BLOB.
|
||||
{
|
||||
public:
|
||||
BLOBInputStream(BLOB& blob);
|
||||
/// Creates the BLOBInputStream with the given BLOB.
|
||||
|
||||
~BLOBInputStream();
|
||||
/// Destroys the BLOBInputStream.
|
||||
};
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
#endif // Data_BLOBStream_INCLUDED
|
@ -43,7 +43,7 @@
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/AbstractExtraction.h"
|
||||
#include "Poco/Data/Bulk.h"
|
||||
#include "Poco/Data/Prepare.h"
|
||||
#include "Poco/Data/Preparation.h"
|
||||
#include <vector>
|
||||
|
||||
|
||||
@ -128,13 +128,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t col)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t col)
|
||||
{
|
||||
Poco::UInt32 limit = getLimit();
|
||||
if (limit != _rResult.size()) _rResult.resize(limit);
|
||||
pPrep->setLength(limit);
|
||||
pPrep->setBulk(true);
|
||||
return new Prepare<C>(pPrep, col, _rResult);
|
||||
return new Preparation<C>(pPrep, col, _rResult);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/AbstractExtraction.h"
|
||||
#include "Poco/Data/Prepare.h"
|
||||
#include "Poco/Data/Preparation.h"
|
||||
#include "Poco/Data/TypeHandler.h"
|
||||
#include "Poco/Data/Column.h"
|
||||
#include "Poco/Data/Position.h"
|
||||
@ -130,9 +130,9 @@ public:
|
||||
return !_extracted;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<T>(pPrep, pos, _rResult);
|
||||
return new Preparation<T>(pPrep, pos, _rResult);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -204,9 +204,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<T>(pPrep, pos, _default);
|
||||
return new Preparation<T>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -285,9 +285,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<bool>(pPrep, pos, _default);
|
||||
return new Preparation<bool>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -364,9 +364,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<T>(pPrep, pos, _default);
|
||||
return new Preparation<T>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -443,9 +443,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<T>(pPrep, pos, _default);
|
||||
return new Preparation<T>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -576,9 +576,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<T>(pPrep, pos, _default);
|
||||
return new Preparation<T>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -635,9 +635,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<T>(pPrep, pos, _default);
|
||||
return new Preparation<T>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -694,9 +694,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<V>(pPrep, pos, _default);
|
||||
return new Preparation<V>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -753,9 +753,9 @@ public:
|
||||
return 1u;
|
||||
}
|
||||
|
||||
AbstractPrepare* createPrepareObject(AbstractPreparation* pPrep, std::size_t pos)
|
||||
AbstractPreparation* createPreparation(AbstractPreparator* pPrep, std::size_t pos)
|
||||
{
|
||||
return new Prepare<V>(pPrep, pos, _default);
|
||||
return new Preparation<V>(pPrep, pos, _default);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -67,6 +67,7 @@ public:
|
||||
FDT_DOUBLE,
|
||||
FDT_STRING,
|
||||
FDT_BLOB,
|
||||
FDT_CLOB,
|
||||
FDT_DATE,
|
||||
FDT_TIME,
|
||||
FDT_TIMESTAMP,
|
||||
|
@ -1,13 +1,13 @@
|
||||
//
|
||||
// Prepare.h
|
||||
// Preparation.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/Prepare.h#8 $
|
||||
// $Id: //poco/Main/Data/include/Poco/Data/Preparation.h#8 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: Prepare
|
||||
// Module: Preparation
|
||||
//
|
||||
// Definition of the Prepare class.
|
||||
// Definition of the Preparation class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -36,12 +36,12 @@
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Prepare_INCLUDED
|
||||
#define Data_Prepare_INCLUDED
|
||||
#ifndef Data_Preparation_INCLUDED
|
||||
#define Data_Preparation_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/AbstractPrepare.h"
|
||||
#include "Poco/Data/AbstractPreparation.h"
|
||||
#include "Poco/Data/TypeHandler.h"
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
@ -52,25 +52,25 @@ namespace Data {
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Prepare: public AbstractPrepare
|
||||
/// Class for calling the appropriate AbstractPreparation method.
|
||||
class Preparation: public AbstractPreparation
|
||||
/// Class for calling the appropriate AbstractPreparator method.
|
||||
{
|
||||
public:
|
||||
Prepare(AbstractPreparation* pPrepare, std::size_t pos, T& val):
|
||||
AbstractPrepare(pPrepare),
|
||||
Preparation(AbstractPreparator* pPreparator, std::size_t pos, T& val):
|
||||
AbstractPreparation(pPreparator),
|
||||
_pos(pos),
|
||||
_val(val)
|
||||
/// Creates the Prepare.
|
||||
/// Creates the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
~Prepare()
|
||||
/// Destroys the Prepare.
|
||||
~Preparation()
|
||||
/// Destroys the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
/// Preparations data.
|
||||
{
|
||||
TypeHandler<T>::prepare(_pos, _val, preparation());
|
||||
}
|
||||
@ -82,27 +82,27 @@ private:
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Prepare<std::vector<T> >: public AbstractPrepare
|
||||
/// Prepare specialization for std::vector.
|
||||
class Preparation<std::vector<T> >: public AbstractPreparation
|
||||
/// Preparation specialization for std::vector.
|
||||
/// This specialization is needed for bulk operations to enforce
|
||||
/// the whole vector preparation, rather than only individual contained values.
|
||||
{
|
||||
public:
|
||||
Prepare(AbstractPreparation* pPrepare, std::size_t pos, std::vector<T>& val = std::vector<T>()):
|
||||
AbstractPrepare(pPrepare),
|
||||
Preparation(AbstractPreparator* pPreparator, std::size_t pos, std::vector<T>& val = std::vector<T>()):
|
||||
AbstractPreparation(pPreparator),
|
||||
_pos(pos),
|
||||
_val(val)
|
||||
/// Creates the Prepare.
|
||||
/// Creates the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
~Prepare()
|
||||
/// Destroys the Prepare.
|
||||
~Preparation()
|
||||
/// Destroys the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
/// Preparations data.
|
||||
{
|
||||
TypeHandler<std::vector<T> >::prepare(_pos, _val, preparation());
|
||||
}
|
||||
@ -114,27 +114,27 @@ private:
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Prepare<std::deque<T> >: public AbstractPrepare
|
||||
/// Prepare specialization for std::deque.
|
||||
class Preparation<std::deque<T> >: public AbstractPreparation
|
||||
/// Preparation specialization for std::deque.
|
||||
/// This specialization is needed for bulk operations to enforce
|
||||
/// the whole deque preparation, rather than only individual contained values.
|
||||
{
|
||||
public:
|
||||
Prepare(AbstractPreparation* pPrepare, std::size_t pos, std::deque<T>& val = std::deque<T>()):
|
||||
AbstractPrepare(pPrepare),
|
||||
Preparation(AbstractPreparator* pPreparator, std::size_t pos, std::deque<T>& val = std::deque<T>()):
|
||||
AbstractPreparation(pPreparator),
|
||||
_pos(pos),
|
||||
_val(val)
|
||||
/// Creates the Prepare.
|
||||
/// Creates the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
~Prepare()
|
||||
/// Destroys the Prepare.
|
||||
~Preparation()
|
||||
/// Destroys the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
/// Preparations data.
|
||||
{
|
||||
TypeHandler<std::deque<T> >::prepare(_pos, _val, preparation());
|
||||
}
|
||||
@ -146,27 +146,27 @@ private:
|
||||
|
||||
|
||||
template<typename T>
|
||||
class Prepare<std::list<T> >: public AbstractPrepare
|
||||
/// Prepare specialization for std::list.
|
||||
class Preparation<std::list<T> >: public AbstractPreparation
|
||||
/// Preparation specialization for std::list.
|
||||
/// This specialization is needed for bulk operations to enforce
|
||||
/// the whole list preparation, rather than only individual contained values.
|
||||
{
|
||||
public:
|
||||
Prepare(AbstractPreparation* pPrepare, std::size_t pos, std::list<T>& val = std::list<T>()):
|
||||
AbstractPrepare(pPrepare),
|
||||
Preparation(AbstractPreparator* pPreparator, std::size_t pos, std::list<T>& val = std::list<T>()):
|
||||
AbstractPreparation(pPreparator),
|
||||
_pos(pos),
|
||||
_val(val)
|
||||
/// Creates the Prepare.
|
||||
/// Creates the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
~Prepare()
|
||||
/// Destroys the Prepare.
|
||||
~Preparation()
|
||||
/// Destroys the Preparation.
|
||||
{
|
||||
}
|
||||
|
||||
void prepare()
|
||||
/// Prepares data.
|
||||
/// Preparations data.
|
||||
{
|
||||
TypeHandler<std::list<T> >::prepare(_pos, _val, preparation());
|
||||
}
|
||||
@ -180,4 +180,4 @@ private:
|
||||
} } // namespace Poco::Data
|
||||
|
||||
|
||||
#endif // Data_Prepare_INCLUDED
|
||||
#endif // Data_Preparation_INCLUDED
|
@ -45,7 +45,7 @@
|
||||
#include "Poco/Data/BulkExtraction.h"
|
||||
#include "Poco/Data/Statement.h"
|
||||
#include "Poco/Data/RowIterator.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/String.h"
|
||||
#include "Poco/Dynamic/Var.h"
|
||||
#include "Poco/Exception.h"
|
||||
@ -173,18 +173,18 @@ public:
|
||||
{
|
||||
case STORAGE_VECTOR:
|
||||
{
|
||||
typedef std::vector<T> C;
|
||||
typedef typename std::vector<T> C;
|
||||
return column<C>(col).value(row);
|
||||
}
|
||||
case STORAGE_LIST:
|
||||
{
|
||||
typedef std::list<T> C;
|
||||
typedef typename std::list<T> C;
|
||||
return column<C>(col).value(row);
|
||||
}
|
||||
case STORAGE_DEQUE:
|
||||
case STORAGE_UNKNOWN:
|
||||
{
|
||||
typedef std::deque<T> C;
|
||||
typedef typename std::deque<T> C;
|
||||
return column<C>(col).value(row);
|
||||
}
|
||||
default:
|
||||
@ -203,18 +203,18 @@ public:
|
||||
{
|
||||
case STORAGE_VECTOR:
|
||||
{
|
||||
typedef std::vector<T> C;
|
||||
typedef typename std::vector<T> C;
|
||||
return column<C>(name).value(row);
|
||||
}
|
||||
case STORAGE_LIST:
|
||||
{
|
||||
typedef std::list<T> C;
|
||||
typedef typename std::list<T> C;
|
||||
return column<C>(name).value(row);
|
||||
}
|
||||
case STORAGE_DEQUE:
|
||||
case STORAGE_UNKNOWN:
|
||||
{
|
||||
typedef std::deque<T> C;
|
||||
typedef typename std::deque<T> C;
|
||||
return column<C>(name).value(row);
|
||||
}
|
||||
default:
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "Poco/Data/Data.h"
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
#include "Poco/Data/AbstractExtractor.h"
|
||||
#include "Poco/Data/AbstractPreparation.h"
|
||||
#include "Poco/Data/AbstractPreparator.h"
|
||||
#include "Poco/Data/Nullable.h"
|
||||
#include "Poco/Tuple.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
@ -103,13 +103,13 @@ class TypeHandler: public AbstractTypeHandler
|
||||
/// TypeHandler<int>::bind(pos++, obj.getAge(), pBinder);
|
||||
/// }
|
||||
///
|
||||
/// static void prepare(std::size_t pos, const Person& obj, AbstractPreparation* pPrepare)
|
||||
/// static void prepare(std::size_t pos, const Person& obj, AbstractPreparator* pPreparator)
|
||||
/// {
|
||||
/// // the table is defined as Person (LastName VARCHAR(30), FirstName VARCHAR, Age INTEGER(3))
|
||||
/// poco_assert_dbg (pPrepare != 0);
|
||||
/// TypeHandler<std::string>::prepare(pos++, obj.getLastName(), pPrepare);
|
||||
/// TypeHandler<std::string>::prepare(pos++, obj.getFirstName(), pPrepare);
|
||||
/// TypeHandler<int>::prepare(pos++, obj.getAge(), pPrepare);
|
||||
/// poco_assert_dbg (pPreparator != 0);
|
||||
/// TypeHandler<std::string>::prepare(pos++, obj.getLastName(), pPreparator);
|
||||
/// TypeHandler<std::string>::prepare(pos++, obj.getFirstName(), pPreparator);
|
||||
/// TypeHandler<int>::prepare(pos++, obj.getAge(), pPreparator);
|
||||
/// }
|
||||
///
|
||||
/// static void extract(std::size_t pos, Person& obj, const Person& defVal, AbstractExtractor* pExt)
|
||||
@ -151,10 +151,10 @@ public:
|
||||
if (!pExt->extract(pos, obj)) obj = defVal;
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, T& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, T& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
pPrepare->prepare(pos, obj);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
pPreparator->prepare(pos, obj);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -186,10 +186,10 @@ public:
|
||||
obj.assign(obj.size(), defVal);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, std::deque<T>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, std::deque<T>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
pPrepare->prepare(pos, obj);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
pPreparator->prepare(pos, obj);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -221,10 +221,10 @@ public:
|
||||
obj.assign(obj.size(), defVal);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, std::vector<T>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, std::vector<T>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
pPrepare->prepare(pos, obj);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
pPreparator->prepare(pos, obj);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -256,10 +256,10 @@ public:
|
||||
obj.assign(obj.size(), defVal);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, std::list<T>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, std::list<T>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
pPrepare->prepare(pos, obj);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
pPreparator->prepare(pos, obj);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -286,16 +286,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, Nullable<T>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, Nullable<T>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
if (obj.isNull())
|
||||
{
|
||||
pPrepare->prepare(pos++, (Poco::Any&)Poco::Data::Keywords::null);
|
||||
pPreparator->prepare(pos++, (Poco::Any&)Poco::Data::Keywords::null);
|
||||
}
|
||||
else
|
||||
{
|
||||
pPrepare->prepare(pos++, (T&)obj.getValue());
|
||||
pPreparator->prepare(pos++, (T&)obj.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,29 +382,29 @@ public:
|
||||
TypeHandler<T19>::bind(pos++, tuple.template get<19>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPrepare);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPrepare);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPrepare);
|
||||
TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPrepare);
|
||||
TypeHandler<T18>::prepare(pos++, tuple.template get<18>(), pPrepare);
|
||||
TypeHandler<T19>::prepare(pos++, tuple.template get<19>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPreparator);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPreparator);
|
||||
TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPreparator);
|
||||
TypeHandler<T18>::prepare(pos++, tuple.template get<18>(), pPreparator);
|
||||
TypeHandler<T19>::prepare(pos++, tuple.template get<19>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -492,28 +492,28 @@ public:
|
||||
TypeHandler<T18>::bind(pos++, tuple.template get<18>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPrepare);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPrepare);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPrepare);
|
||||
TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPrepare);
|
||||
TypeHandler<T18>::prepare(pos++, tuple.template get<18>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPreparator);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPreparator);
|
||||
TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPreparator);
|
||||
TypeHandler<T18>::prepare(pos++, tuple.template get<18>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -598,27 +598,27 @@ public:
|
||||
TypeHandler<T17>::bind(pos++, tuple.template get<17>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPrepare);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPrepare);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPrepare);
|
||||
TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPreparator);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPreparator);
|
||||
TypeHandler<T17>::prepare(pos++, tuple.template get<17>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -700,26 +700,26 @@ public:
|
||||
TypeHandler<T16>::bind(pos++, tuple.template get<16>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPrepare);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPrepare);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPreparator);
|
||||
TypeHandler<T16>::prepare(pos++, tuple.template get<16>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -798,25 +798,25 @@ public:
|
||||
TypeHandler<T15>::bind(pos++, tuple.template get<15>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPrepare);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
|
||||
TypeHandler<T15>::prepare(pos++, tuple.template get<15>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -892,24 +892,24 @@ public:
|
||||
TypeHandler<T14>::bind(pos++, tuple.template get<14>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
TypeHandler<T14>::prepare(pos++, tuple.template get<14>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -982,23 +982,23 @@ public:
|
||||
TypeHandler<T13>::bind(pos++, tuple.template get<13>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
TypeHandler<T13>::prepare(pos++, tuple.template get<13>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1068,22 +1068,22 @@ public:
|
||||
TypeHandler<T12>::bind(pos++, tuple.template get<12>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
TypeHandler<T12>::prepare(pos++, tuple.template get<12>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1150,21 +1150,21 @@ public:
|
||||
TypeHandler<T11>::bind(pos++, tuple.template get<11>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
TypeHandler<T11>::prepare(pos++, tuple.template get<11>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1228,20 +1228,20 @@ public:
|
||||
TypeHandler<T10>::bind(pos++, tuple.template get<10>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
TypeHandler<T10>::prepare(pos++, tuple.template get<10>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1293,19 +1293,19 @@ public:
|
||||
TypeHandler<T9>::bind(pos++, tuple.template get<9>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
TypeHandler<T9>::prepare(pos++, tuple.template get<9>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1355,18 +1355,18 @@ public:
|
||||
TypeHandler<T8>::bind(pos++, tuple.template get<8>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
TypeHandler<T8>::prepare(pos++, tuple.template get<8>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1413,17 +1413,17 @@ public:
|
||||
TypeHandler<T7>::bind(pos++, tuple.template get<7>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
TypeHandler<T7>::prepare(pos++, tuple.template get<7>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1469,16 +1469,16 @@ public:
|
||||
TypeHandler<T6>::bind(pos++, tuple.template get<6>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
TypeHandler<T6>::prepare(pos++, tuple.template get<6>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1522,15 +1522,15 @@ public:
|
||||
TypeHandler<T5>::bind(pos++, tuple.template get<5>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
TypeHandler<T5>::prepare(pos++, tuple.template get<5>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1572,14 +1572,14 @@ public:
|
||||
TypeHandler<T4>::bind(pos++, tuple.template get<4>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
TypeHandler<T4>::prepare(pos++, tuple.template get<4>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1619,13 +1619,13 @@ public:
|
||||
TypeHandler<T3>::bind(pos++, tuple.template get<3>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
TypeHandler<T3>::prepare(pos++, tuple.template get<3>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1663,12 +1663,12 @@ public:
|
||||
TypeHandler<T2>::bind(pos++, tuple.template get<2>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
TypeHandler<T2>::prepare(pos++, tuple.template get<2>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1704,11 +1704,11 @@ public:
|
||||
TypeHandler<T1>::bind(pos++, tuple.template get<1>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
TypeHandler<T1>::prepare(pos++, tuple.template get<1>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1742,10 +1742,10 @@ public:
|
||||
TypeHandler<T0>::bind(pos++, tuple.template get<0>(), pBinder, dir);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, TupleRef tuple, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert (pPrepare != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPrepare);
|
||||
poco_assert (pPreparator != 0);
|
||||
TypeHandler<T0>::prepare(pos++, tuple.template get<0>(), pPreparator);
|
||||
}
|
||||
|
||||
static std::size_t size()
|
||||
@ -1790,11 +1790,11 @@ public:
|
||||
TypeHandler<V>::extract(pos, obj.second, defVal.second, pExt);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, std::pair<K, V>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, std::pair<K, V>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
TypeHandler<K>::prepare(pos, obj.first, pPrepare);
|
||||
TypeHandler<K>::prepare(pos, obj.first, pPreparator);
|
||||
pos += TypeHandler<K>::size();
|
||||
TypeHandler<V>::prepare(pos, obj.second, pPrepare);
|
||||
TypeHandler<V>::prepare(pos, obj.second, pPreparator);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1830,12 +1830,12 @@ public:
|
||||
TypeHandler<T>::extract(pos, *obj, *obj, pExt);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, Poco::AutoPtr<T>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, Poco::AutoPtr<T>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
if (!obj)
|
||||
obj = new T();
|
||||
TypeHandler<T>::prepare(pos, *obj, pPrepare);
|
||||
TypeHandler<T>::prepare(pos, *obj, pPreparator);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1872,12 +1872,12 @@ public:
|
||||
TypeHandler<T>::extract(pos, *obj, *obj, pExt);
|
||||
}
|
||||
|
||||
static void prepare(std::size_t pos, Poco::SharedPtr<T>& obj, AbstractPreparation* pPrepare)
|
||||
static void prepare(std::size_t pos, Poco::SharedPtr<T>& obj, AbstractPreparator* pPreparator)
|
||||
{
|
||||
poco_assert_dbg (pPrepare != 0);
|
||||
poco_assert_dbg (pPreparator != 0);
|
||||
if (!obj)
|
||||
obj = new T();
|
||||
TypeHandler<T>::prepare(pos, *obj, pPrepare);
|
||||
TypeHandler<T>::prepare(pos, *obj, pPreparator);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/DataException.h"
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/Any.h"
|
||||
@ -330,6 +330,24 @@ void AbstractBinder::bind(std::size_t pos, const std::list<BLOB>& val, Direction
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::vector<CLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::vector binder must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::deque<CLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::deque binder must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::list<CLOB>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::list binder must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractBinder::bind(std::size_t pos, const std::vector<DateTime>& val, Direction dir)
|
||||
{
|
||||
throw NotImplementedException("std::vector binder must be implemented.");
|
||||
|
@ -324,6 +324,24 @@ bool AbstractExtractor::extract(std::size_t pos, std::list<BLOB>& val)
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::vector<CLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::deque<CLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::list<CLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list extractor must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
bool AbstractExtractor::extract(std::size_t pos, std::vector<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector extractor must be implemented.");
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// AbstractPreparation.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/src/AbstractPreparation.cpp#1 $
|
||||
// $Id: //poco/Main/Data/src/AbstractPreparation.cpp#2 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
@ -41,10 +41,10 @@ namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
AbstractPreparation::AbstractPreparation(Poco::UInt32 length):
|
||||
_length(length),
|
||||
_bulk(false)
|
||||
AbstractPreparation::AbstractPreparation(AbstractPreparator* pPreparator):
|
||||
_pPreparator(pPreparator)
|
||||
{
|
||||
poco_assert_dbg (_pPreparator);
|
||||
}
|
||||
|
||||
|
||||
@ -53,366 +53,4 @@ AbstractPreparation::~AbstractPreparation()
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::Int8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::Int8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::Int8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::UInt8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::UInt8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::UInt8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::Int16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::Int16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::Int16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::UInt16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::UInt16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::UInt16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::Int32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::Int32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::Int32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::UInt32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::UInt32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::UInt32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::Int64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::Int64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::Int64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<Poco::UInt64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<Poco::UInt64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<bool>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<bool>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<bool>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<float>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<float>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<float>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<double>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<double>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<double>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::vector<char>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::deque<char>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, std::list<char>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<std::string>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<std::string>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<std::string>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<BLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<BLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<BLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<Date>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<Date>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<Date>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<Time>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<Time>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<Time>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::vector<Poco::Dynamic::Var>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::deque<Poco::Dynamic::Var>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparation::prepare(std::size_t pos, const std::list<Poco::Dynamic::Var>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparation must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
||||
|
436
Data/src/AbstractPreparator.cpp
Normal file
436
Data/src/AbstractPreparator.cpp
Normal file
@ -0,0 +1,436 @@
|
||||
//
|
||||
// AbstractPreparator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/src/AbstractPreparator.cpp#1 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: AbstractPreparator
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractPreparator.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
AbstractPreparator::AbstractPreparator(Poco::UInt32 length):
|
||||
_length(length),
|
||||
_bulk(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
AbstractPreparator::~AbstractPreparator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::Int8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::Int8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::Int8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::UInt8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::UInt8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::UInt8>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::Int16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::Int16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::Int16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::UInt16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::UInt16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::UInt16>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::Int32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::Int32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::Int32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::UInt32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::UInt32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::UInt32>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::Int64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::Int64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::Int64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<Poco::UInt64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<Poco::UInt64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<Poco::UInt64>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<long>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<bool>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<bool>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<bool>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<float>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<float>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<float>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<double>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<double>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<double>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::vector<char>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::deque<char>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, std::list<char>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<std::string>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<std::string>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<std::string>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<BLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<BLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<BLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<CLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<CLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<CLOB>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<DateTime>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<Date>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<Date>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<Date>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<Time>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<Time>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<Time>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<Any>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::vector<Poco::Dynamic::Var>& val)
|
||||
{
|
||||
throw NotImplementedException("std::vector preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::deque<Poco::Dynamic::Var>& val)
|
||||
{
|
||||
throw NotImplementedException("std::deque preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
void AbstractPreparator::prepare(std::size_t pos, const std::list<Poco::Dynamic::Var>& val)
|
||||
{
|
||||
throw NotImplementedException("std::list preparator must be implemented.");
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
@ -1,56 +0,0 @@
|
||||
//
|
||||
// AbstractPrepare.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/src/AbstractPrepare.cpp#2 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: AbstractPrepare
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractPrepare.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
AbstractPrepare::AbstractPrepare(AbstractPreparation* pPrepare):
|
||||
_pPrepare(pPrepare)
|
||||
{
|
||||
poco_assert_dbg (_pPrepare);
|
||||
}
|
||||
|
||||
|
||||
AbstractPrepare::~AbstractPrepare()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
@ -1,87 +0,0 @@
|
||||
//
|
||||
// BLOB.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/src/BLOB.cpp#7 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: BLOB
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/Data/BLOB.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
BLOB::BLOB():
|
||||
_pContent(new std::vector<char>())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOB::BLOB(const std::vector<char>& content):
|
||||
_pContent(new std::vector<char>(content))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOB::BLOB(const char* const pContent, std::size_t size):
|
||||
_pContent(new std::vector<char>(pContent, pContent + size))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOB::BLOB(const std::string& content):
|
||||
_pContent(new std::vector<char>(content.begin(), content.end()))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOB::BLOB(const BLOB& other):
|
||||
_pContent(other._pContent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOB::~BLOB()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOB& BLOB::operator = (const BLOB& other)
|
||||
{
|
||||
BLOB tmp(other);
|
||||
swap(tmp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
@ -1,131 +0,0 @@
|
||||
//
|
||||
// BLOBStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/src/BLOBStream.cpp#2 $
|
||||
//
|
||||
// Library: Data
|
||||
// Package: DataCore
|
||||
// Module: BLOBStream
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person or organization
|
||||
// obtaining a copy of the software and accompanying documentation covered by
|
||||
// this license (the "Software") to use, reproduce, display, distribute,
|
||||
// execute, and transmit the Software, and to prepare derivative works of the
|
||||
// Software, and to permit third-parties to whom the Software is furnished to
|
||||
// do so, all subject to the following:
|
||||
//
|
||||
// The copyright notices in the Software and this entire statement, including
|
||||
// the above license grant, this restriction and the following disclaimer,
|
||||
// must be included in all copies of the Software, in whole or in part, and
|
||||
// all derivative works of the Software, unless such copies or derivative
|
||||
// works are solely in the form of machine-executable object code generated by
|
||||
// a source language processor.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
#include "Poco/Data/BLOBStream.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
namespace Data {
|
||||
|
||||
|
||||
//
|
||||
// BLOBStreamBuf
|
||||
//
|
||||
|
||||
|
||||
BLOBStreamBuf::BLOBStreamBuf(BLOB& blob):
|
||||
_blob(blob),
|
||||
_it(_blob.begin())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOBStreamBuf::~BLOBStreamBuf()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
UnbufferedStreamBuf::int_type BLOBStreamBuf::readFromDevice()
|
||||
{
|
||||
if (_it != _blob.end())
|
||||
return charToInt(*_it++);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
UnbufferedStreamBuf::int_type BLOBStreamBuf::writeToDevice(char c)
|
||||
{
|
||||
_blob._pContent->push_back(c);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// BLOBIOS
|
||||
//
|
||||
|
||||
|
||||
BLOBIOS::BLOBIOS(BLOB& blob, openmode mode) :_buf(blob)
|
||||
{
|
||||
poco_ios_init(&_buf);
|
||||
}
|
||||
|
||||
|
||||
BLOBIOS::~BLOBIOS()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BLOBStreamBuf* BLOBIOS::rdbuf()
|
||||
{
|
||||
return &_buf;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// BLOBOutputStream
|
||||
//
|
||||
|
||||
|
||||
BLOBOutputStream::BLOBOutputStream(BLOB& blob):
|
||||
BLOBIOS(blob, std::ios::out),
|
||||
std::ostream(&_buf)
|
||||
{
|
||||
}
|
||||
|
||||
BLOBOutputStream::~BLOBOutputStream()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// BLOBInputStream
|
||||
//
|
||||
|
||||
|
||||
BLOBInputStream::BLOBInputStream(BLOB& blob):
|
||||
BLOBIOS(blob, std::ios::in),
|
||||
std::istream(&_buf)
|
||||
{
|
||||
}
|
||||
|
||||
BLOBInputStream::~BLOBInputStream()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
} } // namespace Poco::Data
|
@ -118,6 +118,7 @@ Poco::Dynamic::Var RecordSet::value(std::size_t col, std::size_t row, bool useFi
|
||||
case MetaColumn::FDT_DOUBLE: return value<double>(col, row, useFilter);
|
||||
case MetaColumn::FDT_STRING: return value<std::string>(col, row, useFilter);
|
||||
case MetaColumn::FDT_BLOB: return value<BLOB>(col, row, useFilter);
|
||||
case MetaColumn::FDT_CLOB: return value<CLOB>(col, row, useFilter);
|
||||
case MetaColumn::FDT_DATE: return value<Date>(col, row, useFilter);
|
||||
case MetaColumn::FDT_TIME: return value<Time>(col, row, useFilter);
|
||||
case MetaColumn::FDT_TIMESTAMP: return value<DateTime>(col, row);
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "Poco/Data/DataException.h"
|
||||
#include "Poco/Data/AbstractBinder.h"
|
||||
#include "Poco/Data/Extraction.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
#include "Poco/Data/Time.h"
|
||||
#include "Poco/SharedPtr.h"
|
||||
|
@ -18,7 +18,7 @@ endif
|
||||
|
||||
objects = DataTestSuite Driver \
|
||||
DataTest SessionPoolTest \
|
||||
Binder Extractor Preparation SessionImpl Connector TestStatementImpl
|
||||
Binder Extractor Preparator SessionImpl Connector TestStatementImpl
|
||||
|
||||
target = testrunner
|
||||
target_version = 1
|
||||
|
@ -313,10 +313,7 @@
|
||||
RelativePath=".\src\Extractor.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.h">
|
||||
RelativePath=".\src\Preparator.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\SessionImpl.h">
|
||||
@ -334,6 +331,9 @@
|
||||
<File
|
||||
RelativePath=".\src\Connector.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparator.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Extractor.cpp">
|
||||
</File>
|
||||
|
@ -440,7 +440,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.h"
|
||||
RelativePath=".\src\Preparator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -468,7 +468,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.cpp"
|
||||
RelativePath=".\src\Preparator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -437,7 +437,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.h"
|
||||
RelativePath=".\src\Preparator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
@ -465,7 +465,7 @@
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Preparation.cpp"
|
||||
RelativePath=".\src\Preparator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
#include "Binder.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
@ -132,6 +132,11 @@ void Binder::bind(std::size_t pos, const BLOB& val, Direction dir)
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const CLOB& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Binder::bind(std::size_t pos, const Date& val, Direction dir)
|
||||
{
|
||||
}
|
||||
|
@ -104,6 +104,9 @@ public:
|
||||
void bind(std::size_t pos, const BLOB& val, Direction dir);
|
||||
/// Binds a BLOB.
|
||||
|
||||
void bind(std::size_t pos, const CLOB& val, Direction dir);
|
||||
/// Binds a CLOB.
|
||||
|
||||
void bind(std::size_t pos, const Date& val, Direction dir);
|
||||
/// Binds a Date.
|
||||
|
||||
|
@ -35,8 +35,8 @@
|
||||
#include "CppUnit/TestSuite.h"
|
||||
#include "Poco/Data/Session.h"
|
||||
#include "Poco/Data/SessionFactory.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/BLOBStream.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Data/LOBStream.h"
|
||||
#include "Poco/Data/MetaColumn.h"
|
||||
#include "Poco/Data/Column.h"
|
||||
#include "Poco/Data/Date.h"
|
||||
@ -75,9 +75,9 @@ using Poco::Data::Session;
|
||||
using Poco::Data::SessionFactory;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::NotSupportedException;
|
||||
using Poco::Data::BLOB;
|
||||
using Poco::Data::BLOBInputStream;
|
||||
using Poco::Data::BLOBOutputStream;
|
||||
using Poco::Data::CLOB;
|
||||
using Poco::Data::CLOBInputStream;
|
||||
using Poco::Data::CLOBOutputStream;
|
||||
using Poco::Data::MetaColumn;
|
||||
using Poco::Data::Column;
|
||||
using Poco::Data::Row;
|
||||
@ -204,31 +204,62 @@ void DataTest::testProperties()
|
||||
}
|
||||
|
||||
|
||||
void DataTest::testBLOB()
|
||||
void DataTest::testLOB()
|
||||
{
|
||||
std::vector<int> vec;
|
||||
vec.push_back(0);
|
||||
vec.push_back(1);
|
||||
vec.push_back(2);
|
||||
vec.push_back(3);
|
||||
vec.push_back(4);
|
||||
vec.push_back(5);
|
||||
vec.push_back(6);
|
||||
vec.push_back(7);
|
||||
vec.push_back(8);
|
||||
vec.push_back(9);
|
||||
|
||||
Poco::Data::LOB<int> lobNum1(&vec[0], vec.size());
|
||||
assert (lobNum1.size() == vec.size());
|
||||
assert (0 == std::memcmp(&vec[0], lobNum1.rawContent(), lobNum1.size() * sizeof(int)));
|
||||
assert (*lobNum1.begin() == 0);
|
||||
Poco::Data::LOB<int>::Iterator it1 = lobNum1.end();
|
||||
assert (*(--it1) == 9);
|
||||
|
||||
Poco::Data::LOB<int> lobNum2(lobNum1);
|
||||
assert (lobNum2.size() == lobNum1.size());
|
||||
assert (lobNum2 == lobNum1);
|
||||
lobNum1.swap(lobNum2);
|
||||
assert (lobNum2 == lobNum1);
|
||||
}
|
||||
|
||||
|
||||
void DataTest::testCLOB()
|
||||
{
|
||||
std::string strDigit = "1234567890";
|
||||
std::string strAlpha = "abcdefghijklmnopqrstuvwxyz";
|
||||
std::vector<char> vecAlpha(strAlpha.begin(), strAlpha.end());
|
||||
std::vector<char> vecDigit(strDigit.begin(), strDigit.end());
|
||||
|
||||
BLOB blobNumStr(strDigit.c_str(), strDigit.size());
|
||||
CLOB blobNumStr(strDigit.c_str(), strDigit.size());
|
||||
assert (blobNumStr.size() == strDigit.size());
|
||||
assert (0 == std::strncmp(strDigit.c_str(), blobNumStr.rawContent(), blobNumStr.size()));
|
||||
assert (*blobNumStr.begin() == '1');
|
||||
assert (*(blobNumStr.end()-1) == '0');
|
||||
BLOB blobNumVec(vecDigit);
|
||||
CLOB::Iterator itNumStr = blobNumStr.end();
|
||||
assert (*(--itNumStr) == '0');
|
||||
CLOB blobNumVec(vecDigit);
|
||||
assert (blobNumVec.size() == vecDigit.size());
|
||||
assert (blobNumVec == blobNumStr);
|
||||
blobNumVec.swap(blobNumStr);
|
||||
assert (blobNumVec.size() == blobNumStr.size());
|
||||
assert (blobNumVec == blobNumStr);
|
||||
|
||||
BLOB blobChrStr(strAlpha.c_str(), strAlpha.size());
|
||||
BLOB blobChrVec(vecAlpha);
|
||||
CLOB blobChrStr(strAlpha.c_str(), strAlpha.size());
|
||||
CLOB blobChrVec(vecAlpha);
|
||||
assert (blobChrStr.size() == strAlpha.size());
|
||||
assert (0 == std::strncmp(strAlpha.c_str(), blobChrStr.rawContent(), blobChrStr.size()));
|
||||
assert (*blobChrStr.begin() == 'a');
|
||||
assert (*(blobChrStr.end()-1) == 'z');
|
||||
CLOB::Iterator itChrStr = blobChrStr.end();
|
||||
assert (*(--itChrStr) == 'z');
|
||||
assert (blobChrStr == blobChrVec);
|
||||
|
||||
blobNumStr.swap(blobChrStr);
|
||||
@ -245,26 +276,26 @@ void DataTest::testBLOB()
|
||||
}
|
||||
|
||||
|
||||
void DataTest::testBLOBStreams()
|
||||
void DataTest::testCLOBStreams()
|
||||
{
|
||||
BLOB blob;
|
||||
CLOB blob;
|
||||
assert (0 == blob.size());
|
||||
|
||||
BLOBOutputStream bos(blob);
|
||||
CLOBOutputStream bos(blob);
|
||||
BinaryWriter bw(bos);
|
||||
|
||||
assert (0 == blob.size());
|
||||
writeToBLOB(bw);
|
||||
writeToCLOB(bw);
|
||||
assert (blob.size() > 0);
|
||||
|
||||
BLOBInputStream bis(blob);
|
||||
CLOBInputStream bis(blob);
|
||||
BinaryReader br(bis);
|
||||
|
||||
readFromBLOB(br);
|
||||
readFromCLOB(br);
|
||||
}
|
||||
|
||||
|
||||
void DataTest::writeToBLOB(BinaryWriter& writer)
|
||||
void DataTest::writeToCLOB(BinaryWriter& writer)
|
||||
{
|
||||
writer << true;
|
||||
writer << false;
|
||||
@ -305,7 +336,7 @@ void DataTest::writeToBLOB(BinaryWriter& writer)
|
||||
}
|
||||
|
||||
|
||||
void DataTest::readFromBLOB(BinaryReader& reader)
|
||||
void DataTest::readFromCLOB(BinaryReader& reader)
|
||||
{
|
||||
bool b = false;
|
||||
reader >> b;
|
||||
@ -1294,8 +1325,9 @@ CppUnit::Test* DataTest::suite()
|
||||
CppUnit_addTest(pSuite, DataTest, testStatementFormatting);
|
||||
CppUnit_addTest(pSuite, DataTest, testFeatures);
|
||||
CppUnit_addTest(pSuite, DataTest, testProperties);
|
||||
CppUnit_addTest(pSuite, DataTest, testBLOB);
|
||||
CppUnit_addTest(pSuite, DataTest, testBLOBStreams);
|
||||
CppUnit_addTest(pSuite, DataTest, testLOB);
|
||||
CppUnit_addTest(pSuite, DataTest, testCLOB);
|
||||
CppUnit_addTest(pSuite, DataTest, testCLOBStreams);
|
||||
CppUnit_addTest(pSuite, DataTest, testColumnVector);
|
||||
CppUnit_addTest(pSuite, DataTest, testColumnVectorBool);
|
||||
CppUnit_addTest(pSuite, DataTest, testColumnDeque);
|
||||
|
@ -53,8 +53,9 @@ public:
|
||||
void testStatementFormatting();
|
||||
void testFeatures();
|
||||
void testProperties();
|
||||
void testBLOB();
|
||||
void testBLOBStreams();
|
||||
void testLOB();
|
||||
void testCLOB();
|
||||
void testCLOBStreams();
|
||||
void testColumnVector();
|
||||
void testColumnVectorBool();
|
||||
void testColumnDeque();
|
||||
@ -80,8 +81,8 @@ private:
|
||||
/// For this to pass, the following condition must be satisifed:
|
||||
/// row1 < row2 < row3
|
||||
|
||||
void writeToBLOB(Poco::BinaryWriter& writer);
|
||||
void readFromBLOB(Poco::BinaryReader& reader);
|
||||
void writeToCLOB(Poco::BinaryWriter& writer);
|
||||
void readFromCLOB(Poco::BinaryReader& reader);
|
||||
};
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
|
||||
#include "Extractor.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
@ -155,6 +155,12 @@ bool Extractor::extract(std::size_t pos, Poco::Data::BLOB& val)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::CLOB& val)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Extractor::extract(std::size_t pos, Poco::Data::Date& val)
|
||||
{
|
||||
return true;
|
||||
|
@ -107,6 +107,9 @@ public:
|
||||
bool extract(std::size_t pos, Poco::Data::BLOB& val);
|
||||
/// Extracts a BLOB.
|
||||
|
||||
bool extract(std::size_t pos, Poco::Data::CLOB& val);
|
||||
/// Extracts a CLOB.
|
||||
|
||||
bool extract(std::size_t pos, Date& val);
|
||||
/// Extracts a Date.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// Preparation.cpp
|
||||
// Preparator.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Data/testsuite/src/Preparation.cpp#3 $
|
||||
// $Id: //poco/Main/Data/testsuite/src/Preparator.cpp#3 $
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -30,8 +30,8 @@
|
||||
//
|
||||
|
||||
|
||||
#include "Preparation.h"
|
||||
#include "Poco/Data/BLOB.h"
|
||||
#include "Preparator.h"
|
||||
#include "Poco/Data/LOB.h"
|
||||
#include "Poco/Exception.h"
|
||||
|
||||
|
||||
@ -40,114 +40,119 @@ namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
Preparation::Preparation()
|
||||
Preparator::Preparator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Preparation::~Preparation()
|
||||
Preparator::~Preparator()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::Int8&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::Int8&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::UInt8&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::UInt8&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::Int16&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::Int16&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::UInt16&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::UInt16&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::Int32&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::Int32&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::UInt32&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::UInt32&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::Int64&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::Int64&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, Poco::UInt64&)
|
||||
void Preparator::prepare(std::size_t pos, Poco::UInt64&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void Preparation::prepare(std::size_t pos, long&)
|
||||
void Preparator::prepare(std::size_t pos, long&)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, bool&)
|
||||
void Preparator::prepare(std::size_t pos, bool&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, float&)
|
||||
void Preparator::prepare(std::size_t pos, float&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, double&)
|
||||
void Preparator::prepare(std::size_t pos, double&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, char&)
|
||||
void Preparator::prepare(std::size_t pos, char&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const std::string&)
|
||||
void Preparator::prepare(std::size_t pos, const std::string&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const Poco::Data::BLOB&)
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::BLOB&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const Poco::Data::Date&)
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::CLOB&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const Poco::Data::Time&)
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::Date&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const Poco::DateTime&)
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Data::Time&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const Poco::Any&)
|
||||
void Preparator::prepare(std::size_t pos, const Poco::DateTime&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparation::prepare(std::size_t pos, const Poco::Dynamic::Var&)
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Any&)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Preparator::prepare(std::size_t pos, const Poco::Dynamic::Var&)
|
||||
{
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
//
|
||||
// Preparation.h
|
||||
// Preparator.h
|
||||
//
|
||||
// $Id: //poco/Main/Data/testsuite/src/Preparation.h#3 $
|
||||
// $Id: //poco/Main/Data/testsuite/src/Preparator.h#3 $
|
||||
//
|
||||
// Definition of the Preparation class.
|
||||
// Definition of the Preparator class.
|
||||
//
|
||||
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -32,11 +32,11 @@
|
||||
//
|
||||
|
||||
|
||||
#ifndef Data_Test_Preparation_INCLUDED
|
||||
#define Data_Test_Preparation_INCLUDED
|
||||
#ifndef Data_Test_Preparator_INCLUDED
|
||||
#define Data_Test_Preparator_INCLUDED
|
||||
|
||||
|
||||
#include "Poco/Data/AbstractPreparation.h"
|
||||
#include "Poco/Data/AbstractPreparator.h"
|
||||
#include "Poco/Any.h"
|
||||
|
||||
|
||||
@ -45,81 +45,84 @@ namespace Data {
|
||||
namespace Test {
|
||||
|
||||
|
||||
class Preparation: public Poco::Data::AbstractPreparation
|
||||
/// A no-op implementation of AbstractPreparation for testing.
|
||||
class Preparator: public Poco::Data::AbstractPreparator
|
||||
/// A no-op implementation of AbstractPreparator for testing.
|
||||
{
|
||||
public:
|
||||
Preparation();
|
||||
/// Creates the Preparation.
|
||||
Preparator();
|
||||
/// Creates the Preparator.
|
||||
|
||||
~Preparation();
|
||||
/// Destroys the Preparation.
|
||||
~Preparator();
|
||||
/// Destroys the Preparator.
|
||||
|
||||
void prepare(std::size_t pos, Poco::Int8&);
|
||||
/// Prepares an Int8.
|
||||
/// Preparations an Int8.
|
||||
|
||||
void prepare(std::size_t pos, Poco::UInt8&);
|
||||
/// Prepares an UInt8.
|
||||
/// Preparations an UInt8.
|
||||
|
||||
void prepare(std::size_t pos, Poco::Int16&);
|
||||
/// Prepares an Int16.
|
||||
/// Preparations an Int16.
|
||||
|
||||
void prepare(std::size_t pos, Poco::UInt16&);
|
||||
/// Prepares an UInt16.
|
||||
/// Preparations an UInt16.
|
||||
|
||||
void prepare(std::size_t pos, Poco::Int32&);
|
||||
/// Prepares an Int32.
|
||||
/// Preparations an Int32.
|
||||
|
||||
void prepare(std::size_t pos, Poco::UInt32&);
|
||||
/// Prepares an UInt32.
|
||||
/// Preparations an UInt32.
|
||||
|
||||
void prepare(std::size_t pos, Poco::Int64&);
|
||||
/// Prepares an Int64.
|
||||
/// Preparations an Int64.
|
||||
|
||||
void prepare(std::size_t pos, Poco::UInt64&);
|
||||
/// Prepares an UInt64.
|
||||
/// Preparations an UInt64.
|
||||
|
||||
#ifndef POCO_LONG_IS_64_BIT
|
||||
void prepare(std::size_t pos, long&);
|
||||
/// Prepares a long.
|
||||
/// Preparations a long.
|
||||
#endif
|
||||
|
||||
void prepare(std::size_t pos, bool&);
|
||||
/// Prepares a boolean.
|
||||
/// Preparations a boolean.
|
||||
|
||||
void prepare(std::size_t pos, float&);
|
||||
/// Prepares a float.
|
||||
/// Preparations a float.
|
||||
|
||||
void prepare(std::size_t pos, double&);
|
||||
/// Prepares a double.
|
||||
/// Preparations a double.
|
||||
|
||||
void prepare(std::size_t pos, char&);
|
||||
/// Prepares a single character.
|
||||
/// Preparations a single character.
|
||||
|
||||
void prepare(std::size_t pos, const std::string&);
|
||||
/// Prepares a string.
|
||||
/// Preparations a string.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::BLOB&);
|
||||
/// Prepares a BLOB.
|
||||
/// Preparations a BLOB.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::CLOB&);
|
||||
/// Preparations a CLOB.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::Date&);
|
||||
/// Prepares a Date.
|
||||
/// Preparations a Date.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Data::Time&);
|
||||
/// Prepares a Time.
|
||||
/// Preparations a Time.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::DateTime&);
|
||||
/// Prepares a DateTime.
|
||||
/// Preparations a DateTime.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Any&);
|
||||
/// Prepares an Any.
|
||||
/// Preparations an Any.
|
||||
|
||||
void prepare(std::size_t pos, const Poco::Dynamic::Var&);
|
||||
/// Prepares a Var.
|
||||
/// Preparations a Var.
|
||||
};
|
||||
|
||||
|
||||
} } } // namespace Poco::Data::Test
|
||||
|
||||
|
||||
#endif // Data_Test_Preparation_INCLUDED
|
||||
#endif // Data_Test_Preparator_INCLUDED
|
@ -56,7 +56,7 @@ void TestStatementImpl::compileImpl()
|
||||
// prepare binding
|
||||
_ptrBinder = new Binder;
|
||||
_ptrExtractor = new Extractor;
|
||||
_ptrPrepare = new Preparation;
|
||||
_ptrPreparation = new Preparator;
|
||||
_compiled = true;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Binder.h"
|
||||
#include "Extractor.h"
|
||||
#include "Preparation.h"
|
||||
#include "Preparator.h"
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -99,10 +99,10 @@ protected:
|
||||
/// Returns the concrete binder used by the statement.
|
||||
|
||||
private:
|
||||
Poco::SharedPtr<Binder> _ptrBinder;
|
||||
Poco::SharedPtr<Extractor> _ptrExtractor;
|
||||
Poco::SharedPtr<Preparation> _ptrPrepare;
|
||||
bool _compiled;
|
||||
Poco::SharedPtr<Binder> _ptrBinder;
|
||||
Poco::SharedPtr<Extractor> _ptrExtractor;
|
||||
Poco::SharedPtr<Preparator> _ptrPreparation;
|
||||
bool _compiled;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user