?? occicontrol.h
字號:
virtual Bytes getRowid(unsigned int paramIndex) = 0; virtual PObject * getObject(unsigned int paramIndex) = 0; virtual Blob getBlob(unsigned int paramIndex) = 0; virtual Clob getClob(unsigned int paramIndex) = 0; virtual Bfile getBfile(unsigned int paramIndex) = 0; virtual IntervalYM getIntervalYM(unsigned int paramIndex) = 0; virtual IntervalDS getIntervalDS(unsigned int paramIndex) = 0; virtual RefAny getRef(unsigned int paramIndex) = 0; virtual ResultSet * getCursor(unsigned int paramIndex) = 0; virtual Connection* getConnection() const =0; };class ResultSet { public: // class constants enum Status { END_OF_FETCH = 0, DATA_AVAILABLE, STREAM_DATA_AVAILABLE }; virtual ~ResultSet(){} // public methods virtual Status next(unsigned int numRows = 1) = 0; virtual Status status() const = 0; virtual unsigned int getNumArrayRows() const = 0; virtual void cancel() = 0; virtual void setMaxColumnSize(unsigned int colIndex, unsigned int max) = 0; virtual unsigned int getMaxColumnSize(unsigned int colIndex) const = 0; virtual bool isNull(unsigned int colIndex) const = 0; virtual bool isTruncated(unsigned int paramIndex) const =0; virtual void setErrorOnNull(unsigned int colIndex, bool causeException) = 0; virtual void setErrorOnTruncate(unsigned int paramIndex, bool causeException) =0; virtual int preTruncationLength(unsigned int paramIndex) const =0; virtual int getInt(unsigned int colIndex) = 0; virtual unsigned int getUInt(unsigned int colIndex) = 0; virtual float getFloat(unsigned int colIndex) = 0; virtual double getDouble(unsigned int colIndex) = 0; virtual Number getNumber(unsigned int colIndex) = 0; virtual OCCI_STD_NAMESPACE::string getString(unsigned int colIndex) = 0; virtual Bytes getBytes(unsigned int colIndex) = 0; virtual Date getDate(unsigned int colIndex) = 0; virtual Timestamp getTimestamp(unsigned int colIndex) = 0; virtual Bytes getRowid(unsigned int colIndex) = 0; virtual PObject * getObject(unsigned int colIndex) = 0; virtual Blob getBlob(unsigned int colIndex) = 0; virtual Clob getClob(unsigned int colIndex) =0; virtual Bfile getBfile(unsigned int colIndex) = 0; virtual IntervalYM getIntervalYM(unsigned int colIndex) =0; virtual IntervalDS getIntervalDS(unsigned int colIndex) =0; virtual RefAny getRef(unsigned int colIndex) = 0; virtual Bytes getRowPosition() const = 0; virtual ResultSet * getCursor(unsigned int colIndex) = 0; virtual void setDataBuffer(unsigned int colIndex, void *buffer, Type type, sb4 size = 0, ub2 *length = NULL, sb2 *ind = NULL, ub2 *rc = NULL) = 0; virtual void setCharSet(unsigned int colIndex, CharSet charSet) = 0; virtual CharSet getCharSet(unsigned int colIndex) const = 0; virtual void setBinaryStreamMode(unsigned int colIndex, unsigned int size) = 0; virtual void setCharacterStreamMode(unsigned int colIndex, unsigned int size) = 0; virtual Stream * getStream(unsigned int colIndex) = 0; virtual void closeStream(Stream *stream) =0; virtual unsigned int getCurrentStreamColumn() const= 0; virtual unsigned int getCurrentStreamRow() const= 0; virtual OCCI_STD_NAMESPACE::vector<MetaData> getColumnListMetaData() const = 0; virtual Statement* getStatement() const=0;};class Stream{ public : enum Status {READY_FOR_READ, READY_FOR_WRITE, INACTIVE}; virtual ~Stream(){} virtual int readBuffer(char *buffer, unsigned int size) =0; virtual int readLastBuffer(char *buffer, unsigned int size) =0; virtual void writeBuffer(char *buffer, unsigned int size) =0; virtual void writeLastBuffer(char *buffer, unsigned int size) =0; virtual Status status() const =0;};/*------------------------ getVector for objects ---------------------------*//* NAME getVector - overloaded function. Retrieves the attribute in the currentposition as a vector of objects PARAMETERS rs - ResultSet vect- reference to vector of objects(OUT parameter). DESCRIPTION Retrieves the column in the specified position as a vector of RefAny. The attribute at the current position should be a collection type (varray or nested table). The SQL type of the elements in the collection should be compatible with objects. RETURNS nothing NOTES compatible SQL types : NTY will call getVector(..., vector<PObject*>)*/template <class T>void getVector( ResultSet *rs, unsigned int index, OCCI_STD_NAMESPACE::vector<T *> &vect) { OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj; getVector(rs, index, vec_pobj); vect.clear(); for (int i=0; i<vec_pobj.size(); i++) vect.push_back((T *)vec_pobj[i]);}template <class T>void getVector( Statement *stmt, unsigned int index, OCCI_STD_NAMESPACE::vector<T *> &vect) { OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj; getVector(stmt, index, vec_pobj); vect.clear(); for (int i=0; i<vec_pobj.size(); i++) vect.push_back((T *)vec_pobj[i]);}/*------------------------ getVector for Ref<T> ---------------------------*//* NAME getVector - overloaded function. Retrieves the attribute in the currentposition as a vector of Ref<T> PARAMETERS rs - ResultSet vect- reference to vector of Ref<T>(OUT parameter). DESCRIPTION Retrieves the column in the specified position as a vector of Ref<T>. The attribute at the current position should be a collection type (varray or nested table). The SQL type of the elements in the collection should be compatible with Ref<T>. RETURNS nothing NOTES compatible SQL types : REF*/template <class T>void getVector( ResultSet *rs, unsigned int index, OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) { OCCI_STD_NAMESPACE::vector<void *> vec_ref; getVector(rs, index, vec_ref, OCCIREF); const Connection *sess = rs->getStatement()->getConnection(); vect.clear(); for (int i=0; i<vec_ref.size(); i++) { if (vec_ref[i] == (OCIRef *)0) vect.push_back(Ref<T>()); // pushing a default-constructed Ref else vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE)); } }/*------------------------ setVector for PObject*---------------------------*//* NAME setVector - overloaded function. Binds the attribute in the current position with a vector of objects. PARAMETERS rs - ResultSet vect- reference to vector of objects(OUT parameter). DESCRIPTION Binds the column in the specified position with a vector of signed int . The column at the current position should be a collection type (varray or nested table). The SQL type of the elements in the collection should be compatible with objects . RETURNS nothing NOTES compatible SQL types : SQLT_NTY This will be calling setVector(..., vector<PObject*>,..)*/template <class T>void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::vector<T *> &vect, const OCCI_STD_NAMESPACE::string &sqltype) { OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj; for (int i = 0; i < vect.size(); i++) vec_pobj.push_back((PObject *)vect[i]); setVector(stmt, index, vec_pobj, sqltype);}/*------------------------ setVector for Ref<T>---------------------------*//* NAME setVector - overloaded function. Binds the attribute in the current position with a vector of Ref<T>. PARAMETERS rs - ResultSet vect- reference to vector of REF DESCRIPTION Binds the column in the specified position with a vector of signed int . The column at the current position should be a collection type (varray or nested table). The SQL type of the elements in the collection should be compatible with OCIRef* . RETURNS nothing NOTES compatible SQL types : REF This will just call setVector(..., vector<OCIRef*>,..)*/template <class T>void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect, const OCCI_STD_NAMESPACE::string &sqltype){ OCCI_STD_NAMESPACE::vector<void *> vec_ref; OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind; for (int i = 0; i < vect.size(); i++) { vec_ref.push_back((void *)vect[i].getRef()); vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL); } setVector(stmt, index, vec_ref, vec_ind, sqltype);}/*------------------------ getVector for Ref<T> ---------------------------*//* NAME getVector - overloaded function. Retrieves the attribute in the currentposition as a vector of Ref<T> PARAMETERS stmt - Statement vect- reference to vector of Ref<T>(OUT parameter). DESCRIPTION Retrieves the column in the specified position as a vector of Ref<T>. The attribute at the current position should be a collection type (varray or nested table). The SQL type of the elements in the collection should be compatible with Ref<T>. RETURNS nothing NOTES compatible SQL types : REF*/template <class T>void getVector( Statement *stmt, unsigned int index, OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) { OCCI_STD_NAMESPACE::vector<void *> vec_ref; getVector(stmt, index, vec_ref, OCCIREF); const Connection *sess = stmt->getConnection(); vect.clear(); for (int i=0; i<vec_ref.size(); i++) { if (vec_ref[i] == (OCIRef *)0) vect.push_back(Ref <T>()); // pushing a default-constructed Ref else vect.push_back(Ref<T> (sess, (OCIRef *)vec_ref[i], FALSE)); } }/*--------------------------------------------------------------------------- EXPORT FUNCTIONS ---------------------------------------------------------------------------*//*--------------------------------------------------------------------------- INTERNAL FUNCTIONS ---------------------------------------------------------------------------*/} /* end of namespace occi */} /* end of namespace oracle */#endif /* OCCICONTROL_ORACLE */#endif /* _olint */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -