?? oracl.h
字號:
private:
void *m_obji; // pointer to object interface
void *m_erri; // pointer to error interface of object
void *m_errotheri; // pointer to error interface on other object
char *m_lasterrstring; // last error string we've handled
int m_errstate; // where did the error come from (values in implementation)
long m_errno; // error number (see below, or negative for internal values)
};
// ----- OOracleCollection -----------------------------------------------
// general set class
// This is a base class used for collections of sessions, connections and fields
// It has no utility on its own. Routines to get items from the collection are
// in the subclasses
class OEXPORT OOracleCollection : public OOracleObject
{
public:
// constructors & destructors
OOracleCollection(void);
OOracleCollection(const OOracleCollection &other);
~OOracleCollection(void);
// Open & Close
oresult Close(void); // close the set
// overloaded operators
OOracleCollection &operator=(const OOracleCollection &other);
// # of items in the set
long GetCount(void) const;
protected:
oresult OpenSetHelper(void *idisp, void *otheri, unsigned char stype); // finish the work of opening the set
void *GetItem(unsigned char stype, int index) const;
void *GetItem(oboolean oflag, const char *name) const;
private:
unsigned char m_settype;
// internal helper routines
oresult Cleanup(void);
oresult Copy(const OOracleCollection &other);
} ;
// ----- OSession -----------------------------------------------
class OEXPORT OSession : public OOracleObject
{
public:
// construction & destruction
OSession(void);
OSession(const OSession &other); // copy constructor
OSession(const char *sname); // construct & open (NULL sname means open default session)
~OSession(void);
// open the session
oresult Open(void); // open the default session
oresult Open(const char *sname); // open a new session with specific name
oresult Close(void);
// Getting other objects
OConnectionCollection GetConnections(void) const;
OClient GetClient(void) const;
static OSession GetNamedSession(const char *sname);
// overloaded operators
OSession &operator=(const OSession &other);
oresult CreateDatabasePool
(long initSize, long maxSize, long timeOut,
const char *dbname, const char *username,
const char *pwd,long options = ODATABASE_DEFAULT);
ODatabase OSession::GetDatabaseFromPool(long waitTime);
oresult OSession::GetUserPwd(const char *username, const char *pwd, char **retname);
oresult OSession::DestroyDatabasePool();
long OSession::GetDbPoolMaxSize() const;
long OSession::GetDbPoolCurrentSize() const;
long OSession::GetDbPoolInitialSize() const;
long OSession::GetDbPoolUsedCount() const;
// error handling
long ServerErrorNumber(void) const;
const char *GetServerErrorText(void) const;
oresult ServerErrorReset(void);
// get properties
const char *GetName(void) const; // returns session name
const char *GetVersion(void) const; // returns version of Oracle Objects
// transaction operations
oresult BeginTransaction(void); // start a transaction
oresult Commit(oboolean startnew = FALSE); // commit (may start new transaction)
oresult Rollback(oboolean startnew = FALSE); // rolls back transaction (may start new transaction)
oresult ResetTransaction(void); // unconditionally rollback (no advisories)
// function used by other classes to construct OSession objects (don't call this!)
oresult OpenHelper(void *idisp, void *otheri);
// Memory Management Routines
oresult MemoryManager (int flags = -1);
oresult MemoryLog (int flags = -1);
private:
char *m_name;
char *m_errtext;
char *m_version;
// internal helper routines
oresult Cleanup(void);
oresult Copy(const OSession &other);
};
// ----- OSessionCollection -----------------------------------------------
class OEXPORT OSessionCollection : public OOracleCollection
{
public:
OSession GetSession(int index) const;
// function used by other classes to construct OSessionCollection objects (don't call this!)
oresult OpenHelper(void *idisp, void *otheri); // finish the work of opening the set
};
// ----- ODatabase -----------------------------------------------
class OEXPORT ODatabase : public OOracleObject
{
public:
// construction & destruction
ODatabase(void);
ODatabase(const ODatabase &other);
~ODatabase(void);
// construct & open
ODatabase(const OSession &dbsess, const char *dbname, const char *username,
const char *pwd, long options = ODATABASE_DEFAULT);
ODatabase(const char *dbname, const char *username, const char *pwd,
long options = ODATABASE_DEFAULT);
// for the Open calls, if pwd is NULL it is assumed that username contains username/password
// open a database on a new session (implicitly creates a session)
oresult Open(const char *dbname, const char *username, const char *pwd,
long options = ODATABASE_DEFAULT);
// open a database on an existing session
oresult Open(const OSession &dbsess, const char *dbname,
const char *username, const char *pwd,
long options = ODATABASE_DEFAULT);
oresult Close(void);
// getting other objects
OSession GetSession(void) const;
OConnection GetConnection(void) const;
OParameterCollection GetParameters(void) const;
// overloaded operators
ODatabase &operator=(const ODatabase &other);
// execute an arbitrary SQL statement
oresult ExecuteSQL(const char *sqlstmt) const;
long GetRowsProcessed(void) const;
// properties
const char *GetName(void) const; // return database name (from the connection)
const char *GetConnectString(void) const; // return connect string (without password)
const char *GetRdbmsVersion(void) const; // V2DEV - returns RDBMS Version
long GetOptions(void) const;
// error handling
long ServerErrorNumber(void) const;
const char *GetServerErrorText(void) const;
oresult ServerErrorReset(void);
int ServerErrorSQLPos(void) const;
// function used by other classes to construct ODatabase objects (don't call this!)
oresult OpenHelper(void *idisp, void *otheri);
private:
long m_numrows;
char *m_dbname;
char *m_dbconnect;
char *m_errtext;
char *m_version;
// internal helper routines
oresult Cleanup(void);
oresult Copy(const ODatabase &other);
oresult GetUserPwd(const char *username, const char *pwd, char **retname);
};
// ----- OValue -----------------------------------------------
class OEXPORT OValue
{
public:
// construction & destruction
OValue(void);
OValue(int intval); // allows OValue val = 3
OValue(long longval); // allows OValue val = 99L;
OValue(double doubleval); // allows initialization with a double
OValue(const char *tval); // allows initialization with a string
OValue(const OValue &other); // copy constructor
OValue(short *intval); // Added for ARRAYINSERT
OValue(int *intval); // Added for ARRAYINSERT
OValue(long *longval); // Added for ARRAYINSERT
OValue(double *doubleval);// Added for ARRAYINSERT
OValue(char **tval); // Added for ARRAYINSERT
~OValue(void);
OValue &operator=(const OValue &other);
int operator==(const OValue &other) const;
int operator!=(const OValue &other) const;
// setting the data & type
oresult Clear(void); // clear the values
oresult SetValue(const OValue &val);
oresult SetValue(const char *val); // sets string value (copies text)
oresult SetValue(int val); // sets to int value
oresult SetValue(long val);
oresult SetValue(double dval); // sets to double value
// oresult SetValue(const void *longval, long len); // set to long value (not implemented)
oresult SetValue(char **val); // Added for ARRAYINSERT
oresult SetValue(short *val); // Added for ARRAYINSERT
oresult SetValue(int *val); // Added for ARRAYINSERT
oresult SetValue(long *val); // Added for ARRAYINSERT
oresult SetValue(double *dval); // Added for ARRAYINSERT
oboolean IsNull(void) const; // returns TRUE if value is NULL (which includes uninitialized)
// getting data (overloaded cast operators)
operator int() const;
operator long() const;
operator const char *() const; // returns 0 if instance isn't string (no allocation)
operator double() const;
// conversions to implementation-specific representations (used by OField)
oresult FromLocalType(void *localv);
// helper routine for implementation of other classes
void *Internal(void) const;
private:
OOLEvar *m_value; // pointer to data representation
// helper routines
oresult Copy(const OValue &other);
oresult Cleanup(void);
};
// ----- ODynaset -----------------------------------------------
class OEXPORT ODynaset : public OOracleObject
{
public:
// construction & destruction
ODynaset(void);
ODynaset(const ODynaset &other);
ODynaset(const ODatabase &odb, const char *sql_statement,
long options = ODYNASET_DEFAULT); // construct & open
// Added for V2DEV custom dynaset
ODynaset(const ODatabase &odb, const char *sql_statement,
unsigned int slicesize, unsigned int perblock,
unsigned int blocks, unsigned int fetchlimit,
unsigned int fetchsize, long options = ODYNASET_DEFAULT);
~ODynaset(void);
// Open takes an SQL query as an argument. This constructs a set of records which can
// then be accessed.
oresult Open(const ODatabase &odb, const char *sql_statement,
long options = ODYNASET_DEFAULT); // creates a dynaset object
// Added for V2DEV custom dynaset
oresult Open(const ODatabase &odb, const char *sql_statement,
unsigned int slicesize, unsigned int perblock,
unsigned int blocks, unsigned int fetchlimit,
unsigned int fetchsize, long options = ODYNASET_DEFAULT);
// The clone of a dynaset is looking at the original data, but has a different navigational
// position. Useful if you want to navigate through a set of data without side-effects
oresult Close(void);
// getting other objects
ODynaset Clone(void) const; // clone a dynaset
ODatabase GetDatabase(void) const;
OFieldCollection GetFields(void) const;
OSession GetSession(void) const;
OField GetField(int index) const;
OField GetField(const char *fieldname) const;
int GetFieldOriginalNameIndex(const char *fieldname) const;
OConnection GetConnection(void) const;
ODynasetMark GetMark(void) const; // bookmark at current position
ODynasetMark GetLastModifiedMark(void) const; // get bookmark at last modified record
// overloaded operators
ODynaset &operator=(const ODynaset &other);
// the sql statement of the dynaset
oresult SetSQL(const char *sql_statement); // sets new sql statement for the dynaset
const char *GetSQL(void) const; // gets sql statement
oresult Refresh(void); // refresh dynaset with current sql statement
// navigation methods
oresult MoveFirst(void); // go to first record in the set
oresult MoveLast(void); // go to last record in the set. Note that this requires that all the records
// in the query be downloaded from the server. Can be expensive.
// MovePrev and MoveNext take a "gopast" argument. If it is TRUE we can navigate to an
// invalid record before the first or after the last. If "gopast" is FALSE, then we won't
// go before the first or after the last record.
oresult MovePrev(oboolean gopast = TRUE); // go to previous record
oresult MoveNext(oboolean gopast = TRUE); // go to next record - the most frequently used
// V2DEV - extra move methods
oresult MovePrevN(long rows, oboolean gopast = TRUE); // go to previous (n) record
oresult MoveNextN(long rows, oboolean gopast = TRUE); // go to next (n) record
oresult MoveRel(long rows, oboolean gopast = TRUE); // go to relative record (n)
oresult MoveTo(long rownum, oboolean gopast = TRUE); // go to record (n)
oresult MoveToMark(const ODynasetMark &odmark); // repositions to mark (see ODynasetMark class)
oboolean IsEOF(void) const; // true if at end of dynaset. Set to TRUE when you have tried to go
// beyond the end
oboolean IsBOF(void) const; // true if at begin of dynaset
oboolean IsValidRecord(void) const; // true if current row is valid
// editing
oboolean CanTransact(void) const; // returns TRUE if transaction processing is enabled
oboolean CanUpdate(void) const; // returns TRUE if this dynaset is updatable
int GetEditMode(void) const; // returns current edit mode: ODYNASET_EDIT_*
oresult StartEdit(void); // starts edit operation
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -