📄 occicontrol.h
字号:
TYP_ATTR_COUNT = 27,
TYPEATTR_ATTR_COUNT = 13,
TYPEMTHD_ATTR_COUNT = 16,
COLL_ATTR_COUNT = 12,
SYN_ATTR_COUNT = 4,
SEQ_ATTR_COUNT = 7,
COL_ATTR_COUNT = 13,
ARG_TYPARG_TYPRES_ATTR_COUNT = 20,
SCHEMA_ATTR_COUNT = 1,
DATABASE_ATTR_COUNT = 13,
UNK_ATTR_COUNT = 0
};
static const AttrId commonAttrId[COMMON_ATTR_COUNT];
static const ociAttrType commonAttrType[COMMON_ATTR_COUNT];
static const AttrId tableAttrId[TABLE_ATTR_COUNT];
static const ociAttrType tableAttrType[TABLE_ATTR_COUNT];
static const AttrId viewAttrId[VIEW_ATTR_COUNT];
static const ociAttrType viewAttrType[VIEW_ATTR_COUNT];
static const AttrId funcprocAttrId[FUNCPROC_ATTR_COUNT];
static const ociAttrType funcprocAttrType[FUNCPROC_ATTR_COUNT];
static const AttrId pkgAttrId[PKG_ATTR_COUNT];
static const ociAttrType pkgAttrType[PKG_ATTR_COUNT];
static const AttrId typAttrId[TYP_ATTR_COUNT];
static const ociAttrType typAttrType[TYP_ATTR_COUNT];
static const AttrId typeattrAttrId[TYPEATTR_ATTR_COUNT];
static const ociAttrType typeattrAttrType[TYPEATTR_ATTR_COUNT];
static const AttrId typmethdAttrId[TYPEMTHD_ATTR_COUNT];
static const ociAttrType typemthdAttrType[TYPEMTHD_ATTR_COUNT];
static const AttrId collAttrId[COLL_ATTR_COUNT];
static const ociAttrType collAttrType[COLL_ATTR_COUNT];
static const AttrId synAttrId[SYN_ATTR_COUNT];
static const ociAttrType synAttrType[SYN_ATTR_COUNT];
static const AttrId seqAttrId[SEQ_ATTR_COUNT];
static const ociAttrType seqAttrType[SEQ_ATTR_COUNT];
static const AttrId colAttrId[COL_ATTR_COUNT];
static const ociAttrType colAttrType[COL_ATTR_COUNT];
static const AttrId argtargtresAttrId[ARG_TYPARG_TYPRES_ATTR_COUNT];
static const ociAttrType argtargtresAttrType[
ARG_TYPARG_TYPRES_ATTR_COUNT];
static const AttrId schemaAttrId[SCHEMA_ATTR_COUNT];
static const ociAttrType schemaAttrType[SCHEMA_ATTR_COUNT];
static const AttrId databaseAttrId[DATABASE_ATTR_COUNT];
static const ociAttrType databaseAttrType[DATABASE_ATTR_COUNT];
Ptr<MetaDataImpl> metaDataImplPtr;
const OCIParam* paramhp;
const ConnectionImpl* sesn;
const AttrId* attrIdArray;
const ociAttrType* attrTypeArray;
AttrCount attrCount;
MetaData(const Connection *sessp, const OCCI_STD_NAMESPACE::string& objName,
ParamType prmtyp ) ;
MetaData(const Connection *sessp,
const RefAny& ref) ;
MetaData(const Connection *sessp, MetaDataImpl *implPtr,
OCIParam* parm) ;
MetaData(const Connection *sessp, MetaDataImpl *implPtr,
OCIParam *parm, ub1 parmTyp) ;
ub1 getParamType(OCIParam* prm) const ;
const AttrId* getAttrIdArrayAddr(ub1 prmTyp) const;
const ociAttrType* getAttrTypeArrayAddr(ub1 prmTyp) const;
AttrCount getAttrCount(ub1 prmTyp) const;
Type getType(ociAttrType typ) const;
bool isListTypeAttribute(AttrId attrid,ub1 ptyp) const;
boolean isInvalidAttrId(AttrId attrid,sb4* pos,
boolean* isTypeSpecificAttrPtr) const;
ociAttrType getValidAttrType(sb4 index, boolean isTypeSpecificAttr)
const;
int getListType (const OCIParam *plist) const;
unsigned int getLowerBound(int ltype) const;
unsigned int getUpperBound(unsigned int ltype,
unsigned int paramnum) const;
friend class ConnectionImpl;
friend class ResultSetImpl;
};
class Connection
{
public :
// specifies the type of proxy to be created,
// used for future enhancements
enum ProxyType
{PROXY_DEFAULT
};
virtual ~Connection() { }
virtual Statement* createStatement(const OCCI_STD_NAMESPACE::string &sql ="")
=0;
virtual void terminateStatement(Statement *statement) =0;
virtual void commit() =0;
virtual void rollback() =0;
virtual MetaData getMetaData(const OCCI_STD_NAMESPACE::string &object,
MetaData::ParamType prmtyp
= MetaData::PTYPE_UNK) const
=0;
virtual MetaData getMetaData(const RefAny &ref) const
=0;
virtual OCCI_STD_NAMESPACE::string getClientCharSet() const
=0;
virtual OCCI_STD_NAMESPACE::string getClientNCHARCharSet() const
=0;
virtual void changePassword(const OCCI_STD_NAMESPACE::string &user,
const OCCI_STD_NAMESPACE::string &oldPassword,
const OCCI_STD_NAMESPACE::string &newPassword)
=0;
virtual void flushCache() =0;
virtual OCIServer* getOCIServer() const =0;
virtual OCISvcCtx* getOCIServiceContext() const =0;
virtual OCISession* getOCISession() const =0;
};
class ConnectionPool
{
public :
virtual ~ConnectionPool() {}
virtual unsigned int getBusyConnections() const
=0;
virtual unsigned int getOpenConnections() const
=0;
virtual unsigned int getMinConnections() const
=0;
virtual unsigned int getMaxConnections() const
=0;
virtual unsigned int getIncrConnections() const
=0;
virtual OCCI_STD_NAMESPACE::string getPoolName() const
=0;
virtual unsigned int getTimeOut() const
=0;
virtual void setErrorOnBusy()
=0;
virtual void setTimeOut(unsigned int connTimeOut =0)
=0;
virtual void setPoolSize(unsigned int minConn =0,
unsigned int maxConn =1, unsigned int incrConn =1)
=0;
virtual Connection* createConnection(
const OCCI_STD_NAMESPACE::string &userName,
const OCCI_STD_NAMESPACE::string &password) =0;
virtual Connection* createProxyConnection(const OCCI_STD_NAMESPACE::string &name,
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
Connection::ProxyType proxyType =
Connection::PROXY_DEFAULT) =0;
virtual Connection* createProxyConnection(const OCCI_STD_NAMESPACE::string &name,
Connection::ProxyType proxyType =
Connection::PROXY_DEFAULT) =0;
virtual void terminateConnection
(Connection *connection) =0;
};
class Environment
{
public:
// class constants
enum Mode
{
DEFAULT = OCI_DEFAULT,
OBJECT = OCI_OBJECT,
SHARED = OCI_SHARED,
NO_USERCALLBACKS = OCI_NO_UCB,
THREADED_MUTEXED = OCI_THREADED,
THREADED_UNMUTEXED = OCI_THREADED | OCI_ENV_NO_MUTEX
};
virtual ~Environment(){}
// public methods
static Environment * createEnvironment(
Mode mode = DEFAULT,
void *ctxp = 0,
void *(*malocfp)(void *ctxp, size_t size) = 0,
void *(*ralocfp)(void *ctxp, void *memptr,
size_t newsize) = 0,
void (*mfreefp)(void *ctxp, void *memptr) = 0);
static void terminateEnvironment(Environment *env);
virtual Connection * createConnection(const OCCI_STD_NAMESPACE::string &userName,
const OCCI_STD_NAMESPACE::string &password, const OCCI_STD_NAMESPACE::string &connectString = "") = 0;
virtual void terminateConnection(Connection *connection) = 0;
virtual ConnectionPool* createConnectionPool(
const OCCI_STD_NAMESPACE::string &poolUserName,
const OCCI_STD_NAMESPACE::string &poolPassword, const OCCI_STD_NAMESPACE::string &connectString ="",
unsigned int minConn =0,
unsigned int maxConn =1, unsigned int incrConn =1) = 0;
virtual void terminateConnectionPool(ConnectionPool *poolp) = 0;
virtual unsigned int getCurrentHeapSize() const = 0;
virtual OCIEnv * getOCIEnvironment() const = 0;
virtual Map *getMap() const = 0;
virtual void setCacheMaxSize(unsigned int maxSize) = 0;
virtual unsigned int getCacheMaxSize() const = 0;
virtual void setCacheOptSize(unsigned int OptSize) = 0;
virtual unsigned int getCacheOptSize() const = 0;
private:
};
class Map
{
public:
virtual ~Map(){}
virtual void put(const OCCI_STD_NAMESPACE::string&, void *(*)(void *),
void (*)(void *, void *)) = 0;
virtual void getReadSQL(const OCCI_STD_NAMESPACE::string&, void **) const = 0;
virtual void getWriteSQL(const OCCI_STD_NAMESPACE::string&, void **) const = 0;
private:
};
class SQLException : public OCCI_STD_NAMESPACE::exception
{
public:
virtual int getErrorCode() const;
virtual OCCI_STD_NAMESPACE::string getMessage() const;
const char *what() const throw();
virtual void setErrorCtx(void *ctx);
SQLException();
SQLException(const SQLException &e);
void operator=(const SQLException &other);
virtual ~SQLException() throw();
private:
Ptr<SQLExceptionImpl> ptr_;
SQLException(SQLExceptionImpl *ptr);
friend SQLException SQLExceptionCreate(int errorCode);
friend SQLException SQLExceptionCreate(dvoid *handle,
int handleType);
};
class Statement
{
public:
// class constants
virtual ~Statement() {}
enum Status
{
UNPREPARED,
PREPARED,
RESULT_SET_AVAILABLE,
UPDATE_COUNT_AVAILABLE,
NEEDS_STREAM_DATA,
STREAM_DATA_AVAILABLE
};
// common methods
virtual void setSQL(const OCCI_STD_NAMESPACE::string &sql) = 0;
virtual OCCI_STD_NAMESPACE::string getSQL() const = 0;
virtual Status execute(const OCCI_STD_NAMESPACE::string &sql = "") = 0;
virtual ResultSet * getResultSet() = 0;
virtual unsigned int getUpdateCount() const = 0;
virtual ResultSet * executeQuery(const OCCI_STD_NAMESPACE::string &sql = "") = 0;
virtual unsigned int executeUpdate(const OCCI_STD_NAMESPACE::string &sql = "") = 0;
virtual Status status() const = 0;
virtual void closeResultSet(ResultSet *resultSet) = 0;
virtual void setPrefetchRowCount(unsigned int rowCount) = 0;
virtual void setPrefetchMemorySize(unsigned int bytes) = 0;
virtual void setAutoCommit(bool autoCommit) = 0;
virtual bool getAutoCommit() const = 0;
virtual OCIStmt * getOCIStatement() const = 0;
// methods for prepared statements with IN
// parameters
virtual void setMaxParamSize(unsigned int paramIndex,unsigned int maxSize)=0;
virtual unsigned int getMaxParamSize(unsigned int paramIndex) const = 0;
virtual void setNull(unsigned int paramIndex, Type type) = 0;
virtual void setInt(unsigned int paramIndex, int x) = 0;
virtual void setUInt(unsigned int paramIndex, unsigned int x) = 0;
virtual void setFloat(unsigned int paramIndex, float x) = 0;
virtual void setDouble(unsigned int paramIndex, double x) = 0;
virtual void setNumber(unsigned int paramIndex, const Number &x) = 0;
virtual void setString(unsigned int paramIndex, const OCCI_STD_NAMESPACE::string &x) = 0;
virtual void setBytes(unsigned int paramIndex, const Bytes &x) = 0;
virtual void setDate(unsigned int paramIndex, const Date &x) = 0;
virtual void setTimestamp(unsigned int paramIndex, const Timestamp &x) = 0;
virtual void setBlob(unsigned int paramIndex, const Blob &x) = 0;
virtual void setClob(unsigned int paramIndex, const Clob &x) = 0;
virtual void setBfile(unsigned int paramIndex, const Bfile &x) = 0;
virtual void setIntervalYM(unsigned int paramIndex, const IntervalYM &x) = 0;
virtual void setIntervalDS(unsigned int paramIndex, const IntervalDS &x) = 0;
virtual void setRowid(unsigned int paramIndex, const Bytes &x) = 0;
virtual void setRef(unsigned int paramIndex, const RefAny &x) = 0;
virtual void setObject(unsigned int paramIndex, PObject * x) = 0;
virtual void setDataBuffer(unsigned int paramIndex, void *buffer,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -