⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 occicontrol.h

📁 SQLAPI C/C++ 连接Oracle 数据库!
💻 H
📖 第 1 页 / 共 3 页
字号:
  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 + -