53 #define NCBI_USE_ERRCODE_X Dbapi_ObjImpls
71 m_RowReadType(eReadUnknown)
76 _TRACE(
"CResultSet::ctor(): null CDB_Result* object");
112 _TRACE(
"CResultSet::Init(): Space reserved for " <<
m_data.size()
204 if (more &&
m_data.size() == 0) {
229 _TRACE(
"CResulstSet: deleting BLOB output stream...");
234 _TRACE(
"CResulstSet: deleting BLOB input stream...");
239 _TRACE(
"CResulstSet: deleting BLOB reader...");
275 _TRACE(
"CResulstSet: No available column for Read(), current column: "
354 flags, buf_size,
true);
364 flags, buf_size,
false);
385 if(desc.get() ==
NULL) {
387 NcbiCerr <<
"CResultSet::GetBlobOStream(): zero IT Descriptor" << endl;
429 _TRACE(
"Discarding old CDB_Result " << (
void*)
m_rs);
459 NCBI_DBAPI_THROW(
"CResultSet::GetColNum(): invalid column name [" + name +
"]" );
464 if ( idx >
m_data.size() ) {
466 NcbiCerr <<
"CResultSet::CheckIdx(): Column index " << idx <<
" out of range" << endl;
void RemoveListener(CActiveObject *obj)
void SetIdent(const string &name)
void AddListener(CActiveObject *obj)
void Notify(const CDbapiEvent &e)
CDB_Connection * CloneCDB_Conn()
CActiveObject * GetSource() const
Note about the "buf_size" parameter for streams in this API.
@ fLogExceptions
Exceptions logged only.
@ fOwnReader
Own the underlying reader.
@ fOwnWriter
Own the underlying writer.
void CheckIdx(unsigned int idx)
virtual CNcbiIstream & GetBlobIStream(size_t buf_size)
Get Blob input stream.
CNcbiOstream & xGetBlobOStream(CDB_Connection *cdb_conn, size_t blob_size, TBlobOStreamFlags flags, size_t buf_size, bool destroy)
virtual const CVariant & GetVariant(const CDBParamVariant ¶m)
Retrieve a CVariant class describing the data stored in a given column.
class CConnection * m_conn
virtual bool Next()
Get next row.
int GetColNum(const string &name)
virtual void Close()
Close resultset.
vector< CVariant > m_data
virtual int GetColumnNo()
Get column number, currently available for Read()
virtual void BindBlobToVariant(bool b)
Bind blob to variant.
ERowReadType m_RowReadType
virtual size_t Read(void *buf, size_t size)
Read unformatted data.
virtual EDB_ResType GetResultType()
Get result type.
virtual void DisableBind(bool b)
Disables column binding.
CResultSet(class CConnection *conn, CDB_Result *rs)
virtual CNcbiOstream & GetBlobOStream(size_t blob_size, TBlobOStreamFlags flags, size_t buf_size)
Get Blob output stream.
void x_CacheItems(int last_num)
virtual void Action(const CDbapiEvent &e)
virtual bool WasNull()
Determine if last column was NULL.
virtual const IResultSetMetaData * GetMetaData(EOwnership ownership)
Get Metadata.
CResultSetMetaData * m_metaData
virtual unsigned int GetTotalColumns()
Get total columns.
virtual IReader * GetBlobReader()
Get a Blob Reader.
Writer-based output stream.
A very basic data-read interface.
The NCBI C++ standard methods for dealing with std::string.
#define NCBI_DBAPI_THROW(message)
static CS_CONNECTION * conn
@ eTakeOwnership
An object can take ownership of another.
virtual CNcbiOstream & GetBlobOStream(size_t blob_size, TBlobOStreamFlags flags=0, size_t buf_size=0)=0
Get Blob output stream.
bool IsPositional(void) const
unsigned int GetPosition(void) const
const string & GetName(void) const
virtual EDB_ResType ResultType() const
Get type of the result.
virtual size_t ItemMaxSize(unsigned int item_num) const
Get size (in bytes) of a result item.
virtual EDB_Type ItemDataType(unsigned int item_num) const
Get datatype of a result item.
virtual int CurrentItemNo() const
Return current item number we can retrieve (0,1,...)
virtual size_t ReadItem(void *buffer, size_t buffer_size, bool *is_null=0)
Read a result item body (for BLOB columns, mostly).
virtual CDB_Object * GetItem(CDB_Object *item_buf=0, EGetItem policy=eAppendLOB)
Get a result item (you can use either GetItem or ReadItem).
virtual const char * ItemName(unsigned int item_num) const
Get name of a result item.
virtual unsigned int NofItems() const
Get # of items (columns) in the result.
virtual I_BlobDescriptor * GetBlobDescriptor()
Get a descriptor for a BLOB column (for SendData).
virtual bool Fetch()
Fetch next row.
static bool IsBlobType(EDB_Type db_type)
CDB_Object * GetNonNullData() const
static CVariant LongChar(const char *p, size_t len=0)
static CVariant LongBinary(size_t maxSize, const void *p, size_t len)
static CVariant Binary(size_t size, const void *p, size_t len)
static CVariant Char(size_t size, const char *p)
void SetBlobDescriptor(I_BlobDescriptor *descr)
#define NCBI_CATCH_ALL_X(err_subcode, message)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static int Compare(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Compare of a substring with another string.
CTime Truncate(const CTime &t)
enum ENcbiOwnership EOwnership
Ownership relations between objects.
Definition of all error codes used in dbapi libraries (dbapi_driver.lib and others).
const struct ncbi::grid::netcache::search::fields::SIZE size