OCILIB (C and C++ Driver for Oracle)  4.6.0
ocilib.hpp
1 /*
2  * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3  *
4  * Website: http://www.ocilib.net
5  *
6  * Copyright (c) 2007-2018 Vincent ROGIER <vince.rogier@ocilib.net>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 /*
22  * IMPORTANT NOTICE
23  *
24  * This C++ header defines C++ wrapper classes around the OCILIB C API
25  * It requires a compatible version of OCILIB
26  *
27  */
28 
29 #ifndef OCILIBCPP_H_INCLUDED
30 #define OCILIBCPP_H_INCLUDED
31 
32 /* includes */
33 
34 #include <string>
35 #include <list>
36 #include <vector>
37 #include <iterator>
38 #include <cstddef>
39 
40 extern "C"{
41 #include "ocilib.h"
42 }
43 
49 namespace ocilib
50 {
51 
160 typedef std::basic_string<otext, std::char_traits<otext>, std::allocator<otext> > ostring;
161 
169 typedef void * AnyPointer;
170 
178 typedef std::vector<unsigned char> Raw;
179 
188 
197 
205 typedef const void * ThreadId;
206 
214 typedef void * CallbackPointer;
215 
216 }
217 
218 /* Including core classes */
219 
220 #include "ocilib_core.hpp"
221 
222 /* Defining public classes */
223 
224 namespace ocilib
225 {
226 
233 {
234  Oracle80 = OCI_8_0,
235  Oracle8i = OCI_8_1,
236  Oracle9iR1 = OCI_9_0,
237  Oracle9iR2 = OCI_9_2,
238  Oracle10gR1 = OCI_10_1,
239  Oracle10gR2 = OCI_10_2,
240  Oracle11gR1 = OCI_11_1,
241  Oracle11gR2 = OCI_11_2,
242  Oracle12cR1 = OCI_12_1,
243  Oracle18cR1 = OCI_18_1,
244  Oracle18cR2 = OCI_18_2,
245  Oracle18cR3 = OCI_18_3
246 };
247 
256 
263 {
265  TypeNumeric = OCI_CDT_NUMERIC,
267  TypeDate = OCI_CDT_DATETIME,
269  TypeString = OCI_CDT_TEXT,
271  TypeLong = OCI_CDT_LONG,
273  TypeStatement = OCI_CDT_CURSOR,
275  TypeLob = OCI_CDT_LOB,
277  TypeFile = OCI_CDT_FILE,
279  TypeTimestamp = OCI_CDT_TIMESTAMP,
281  TypeInterval = OCI_CDT_INTERVAL,
283  TypeRaw = OCI_CDT_RAW,
285  TypeObject = OCI_CDT_OBJECT,
287  TypeCollection = OCI_CDT_COLLECTION,
289  TypeReference = OCI_CDT_REF,
291  TypeBoolean = OCI_CDT_BOOLEAN
292 };
293 
302 
309 {
311  NumericShort = OCI_NUM_SHORT,
313  NumericInt = OCI_NUM_INT,
315  NumericBigInt = OCI_NUM_BIGINT,
317  NumericUnsignedShort = OCI_NUM_USHORT,
319  NumericUnsignedInt = OCI_NUM_UINT,
321  NumericUnsignedBigInt = OCI_NUM_BIGUINT,
323  NumericDouble = OCI_NUM_DOUBLE,
325  NumericFloat = OCI_NUM_FLOAT,
327  NumericNumber = OCI_NUM_NUMBER
328 };
329 
338 
345 {
347  CharsetFormDefault = OCI_CSF_DEFAULT,
349  CharsetFormNational = OCI_CSF_NATIONAL
350 };
351 
360 
367 {
369  CollationIDNone = OCI_CCI_NONE,
371  CollationIDNlsComp = OCI_CCI_NLS_COMP,
373  CollationIDNlsSort = OCI_CCI_NLS_SORT,
375  CollationIDNlsSortCI = OCI_CCI_NLS_SORT_CI,
377  CollationIDNlsSortAI = OCI_CCI_NLS_SORT_AI,
379  CollationIDNlsSortCS = OCI_CCI_NLS_SORT_CS,
381  CollationIDNlsSortVar1 = OCI_CCI_NLS_SORT_VAR1,
383  CollationIDNlsSortVar1CI = OCI_CCI_NLS_SORT_VAR1_CI,
385  CollationIDNlsSortVar1AI = OCI_CCI_NLS_SORT_VAR1_AI,
387  CollationIDNlsSortVar1CS = OCI_CCI_NLS_SORT_VAR1_CS,
389  CollationIDBinary = OCI_CCI_BINARY,
391  CollationIDBinaryCI = OCI_CCI_BINARY_CI,
393  CollationIDBinaryAI = OCI_CCI_BINARY_AI
394 };
395 
404 
405 
412 {
414  SeekSet = OCI_SEEK_SET,
416  SeekEnd = OCI_SEEK_END,
418  SeekOffset = OCI_SEEK_CUR
419 };
420 
429 
436 {
438  ReadOnly = OCI_LOB_READONLY,
440  ReadWrite = OCI_LOB_READWRITE
441 };
442 
451 
458 {
460  LobBinary = OCI_BLOB,
462  LobCharacter = OCI_CLOB,
464  LobNationalCharacter = OCI_NCLOB
465 };
466 
475 
482 {
484  LongBinary = OCI_BLONG,
486  LongCharacter = OCI_CLONG
487 };
488 
497 
504 {
506  FormatDate = OCI_FMT_DATE,
508  FormatTimestamp = OCI_FMT_TIMESTAMP,
510  FormatNumeric = OCI_FMT_NUMERIC,
512  FormatBinaryDouble = OCI_FMT_BINARY_DOUBLE,
514  FormatBinaryFloat = OCI_FMT_BINARY_FLOAT
515 };
516 
525 
534 class Exception : public std::exception
535 {
536  template<class T>
537  friend T Check(T result);
538  friend class Statement;
539 
540 public:
541 
548  {
550  OracleError = OCI_ERR_ORACLE,
552  OcilibError = OCI_ERR_OCILIB,
554  OracleWarning = OCI_ERR_WARNING
555  };
556 
565 
571  ostring GetMessage() const;
572 
579  ExceptionType GetType() const;
580 
586  int GetOracleErrorCode() const;
587 
593  int GetInternalErrorCode() const;
594 
600  Statement GetStatement() const;
601 
607  Connection GetConnection() const;
608 
621  unsigned int GetRow() const;
622 
631  const char *what() const throw() override;
632 
638  virtual ~Exception() throw ();
639 
640 private:
641 
642  Exception();
643  Exception(OCI_Error *err);
644 
645  std::string _what;
646  OCI_Statement *_pStatement;
647  OCI_Connection *_pConnnection;
648  unsigned int _row;
649  ExceptionType _type;
650  int _errLib;
651  int _errOracle;
652 };
653 
660 {
661  friend class Mutex;
662  friend class Connection;
663  friend class Pool;
664  friend class Subscription;
665  friend class Dequeue;
666  template<class>
667  friend class HandleHolder;
668 
669 public:
670 
677  {
679  SourceInstance = OCI_HES_INSTANCE,
681  SourceDatabase = OCI_HES_DATABASE,
683  SourceNode = OCI_HES_NODE,
685  SourceService = OCI_HES_SERVICE,
687  SourceServiceMember = OCI_HES_SERVICE_MEMBER,
689  SourceASMInstance = OCI_HES_ASM_INSTANCE,
691  SourcePreConnect = OCI_HES_PRECONNECT
692  };
693 
702 
709  {
711  EventDown = OCI_HET_DOWN,
713  EventUp = OCI_HET_UP
714  };
715 
724 
731  {
733  Default = OCI_ENV_DEFAULT,
735  Threaded = OCI_ENV_THREADED,
737  Events = OCI_ENV_EVENTS
738  };
739 
748 
755  {
757  ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
759  ImportRuntime = OCI_IMPORT_MODE_RUNTIME
760  };
761 
770 
777  {
779  CharsetAnsi = OCI_CHAR_ANSI,
781  CharsetWide = OCI_CHAR_WIDE
782  };
783 
792 
799  {
801  SessionDefault = OCI_SESSION_DEFAULT,
803  SessionXa = OCI_SESSION_XA,
805  SessionSysDba = OCI_SESSION_SYSDBA,
807  SessionSysOper = OCI_SESSION_SYSOPER,
809  SessionSysAsm = OCI_SESSION_SYSASM,
811  SessionSysBkp = OCI_SESSION_SYSBKP,
813  SessionSysDgD = OCI_SESSION_SYSDGD,
815  SessionSysKmt = OCI_SESSION_SYSKMT,
817  SessionSysRac = OCI_SESSION_SYSRAC,
819  SessionPreAuth = OCI_SESSION_PRELIM_AUTH
820  };
821 
830 
837  {
839  StartOnly = OCI_DB_SPM_START,
841  StartMount = OCI_DB_SPM_MOUNT,
843  StartOpen = OCI_DB_SPM_OPEN,
845  StartFull = OCI_DB_SPM_FULL
846  };
847 
856 
863  {
865  StartDefault = OCI_DB_SPF_DEFAULT,
867  StartForce = OCI_DB_SPF_FORCE,
869  StartRestrict = OCI_DB_SPF_RESTRICT
870  };
871 
880 
887  {
889  ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
891  ShutdownClose = OCI_DB_SDM_CLOSE,
893  ShutdownDismount = OCI_DB_SDM_DISMOUNT,
895  ShutdownFull = OCI_DB_SDM_FULL
896  };
897 
906 
913  {
916  ShutdowntDefault = OCI_DB_SDF_DEFAULT,
919  ShutdowTrans = OCI_DB_SDF_TRANS,
923  ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
926  ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
932  ShutdownAbort = OCI_DB_SDF_ABORT
933  };
934 
943 
950  {
952  OracleClientBytes = OCI_MEM_ORACLE,
954  OcilibBytes = OCI_MEM_OCILIB,
956  AllBytes = OCI_MEM_ALL
957  };
958 
967 
975  typedef void(*HAHandlerProc) (Connection &con, HAEventSource eventSource, HAEventType eventType, Timestamp &time);
976 
995  static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
996 
1010  static void Cleanup();
1011 
1020  static Environment::EnvironmentFlags GetMode();
1021 
1027  static Environment::ImportMode GetImportMode();
1028 
1034  static Environment::CharsetMode GetCharset();
1035 
1045  static unsigned int GetCharMaxSize();
1046 
1054  static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
1055 
1061  static bool Initialized();
1062 
1073  static OracleVersion GetCompileVersion();
1074 
1080  static unsigned int GetCompileMajorVersion();
1081 
1087  static unsigned int GetCompileMinorVersion();
1088 
1094  static unsigned int GetCompileRevisionVersion();
1095 
1105  static OracleVersion GetRuntimeVersion();
1106 
1112  static unsigned int GetRuntimeMajorVersion();
1113 
1119  static unsigned int GetRuntimeMinorVersion();
1120 
1126  static unsigned int GetRuntimeRevisionVersion();
1127 
1138  static void EnableWarnings(bool value);
1139 
1171  static bool SetFormat(FormatType formatType, const ostring& format);
1172 
1183  static ostring GetFormat(FormatType formatType);
1184 
1211  static void StartDatabase(const ostring &db, const ostring &user, const ostring& pwd,
1212  Environment::StartFlags startFlags,
1213  Environment::StartMode startMode,
1214  Environment::SessionFlags sessionFlags = SessionSysDba,
1215  const ostring& spfile = OTEXT(""));
1216 
1242  static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1243  Environment::ShutdownFlags shutdownFlags,
1244  Environment::ShutdownMode shutdownMode,
1245  Environment::SessionFlags sessionFlags = SessionSysDba);
1246 
1257  static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1258 
1275  static void SetHAHandler(HAHandlerProc handler);
1276 
1277 private:
1278 
1279  class EnvironmentHandle : HandleHolder < AnyPointer >
1280  {
1281  friend class Environment;
1282  };
1283 
1284  static void HAHandler(OCI_Connection *pConnection, unsigned int source, unsigned int event, OCI_Timestamp *pTimestamp);
1285  static unsigned int TAFHandler(OCI_Connection *pConnection, unsigned int type, unsigned int event);
1286  static void NotifyHandler(OCI_Event *pEvent);
1287  static void NotifyHandlerAQ(OCI_Dequeue *pDequeue);
1288 
1289  template<class T>
1290  static T GetUserCallback(AnyPointer ptr);
1291 
1292  template<class T>
1293  static void SetUserCallback(AnyPointer ptr, T callback);
1294 
1295  template<class T>
1296  static void SetSmartHandle(AnyPointer ptr, T handle);
1297 
1298  template<class T>
1299  static T GetSmartHandle(AnyPointer ptr);
1300 
1301  static Handle * GetEnvironmentHandle();
1302 
1303  static Environment& GetInstance();
1304 
1305  Environment();
1306 
1307  void SelfInitialize(EnvironmentFlags mode, const ostring& libpath);
1308  void SelfCleanup();
1309 
1310  Locker _locker;
1311  EnvironmentHandle _handle;
1312  ConcurrentMap<AnyPointer, Handle *> _handles;
1313  ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1314  EnvironmentFlags _mode;
1315  unsigned int _charMaxSize;
1316  bool _initialized;
1317 };
1318 
1329 class Thread
1330 {
1331 public:
1332 
1340 
1349  static ThreadHandle Create();
1350 
1358  static void Destroy(ThreadHandle handle);
1359 
1369  static void Run(ThreadHandle handle, ThreadProc func, void *args);
1370 
1381  static void Join(ThreadHandle handle);
1382 
1390  static ThreadId GetThreadId(ThreadHandle handle);
1391 };
1392 
1402 class Mutex
1403 {
1404 public:
1405 
1414  static MutexHandle Create();
1415 
1423  static void Destroy(MutexHandle handle);
1424 
1432  static void Acquire(MutexHandle handle);
1433 
1441  static void Release(MutexHandle handle);
1442 };
1443 
1455 {
1456 public:
1457 
1465 
1478  static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1479 
1488  static void SetValue(const ostring& name, AnyPointer value);
1489 
1500  static AnyPointer GetValue(const ostring& name);
1501 };
1502 
1510 class Pool : public HandleHolder<OCI_Pool *>
1511 {
1512 public:
1513 
1520  {
1522  ConnectionPool = OCI_POOL_CONNECTION,
1524  SessionPool = OCI_POOL_SESSION
1525  };
1526 
1535 
1541  Pool();
1542 
1560  Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1561  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1563 
1582  void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1583  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1585 
1591  void Close();
1592 
1621  Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1622 
1634  unsigned int GetTimeout() const;
1635 
1649  void SetTimeout(unsigned int value);
1650 
1660  bool GetNoWait() const;
1661 
1674  void SetNoWait(bool value);
1675 
1681  unsigned int GetBusyConnectionsCount() const;
1682 
1688  unsigned int GetOpenedConnectionsCount() const;
1689 
1695  unsigned int GetMinSize() const;
1696 
1702  unsigned int GetMaxSize() const;
1703 
1709  unsigned int GetIncrement() const;
1710 
1719  unsigned int GetStatementCacheSize() const;
1720 
1728  void SetStatementCacheSize(unsigned int value);
1729 };
1730 
1738 class Connection : public HandleHolder<OCI_Connection *>
1739 {
1740  friend class Environment;
1741  friend class Exception;
1742  friend class Statement;
1743  friend class File;
1744  friend class Timestamp;
1745  friend class Pool;
1746  friend class Object;
1747  friend class TypeInfo;
1748  friend class Reference;
1749  friend class Resultset;
1750  friend class Subscription;
1751 
1752  template<class, int>
1753  friend class Lob;
1754  template<class>
1755  friend class Collection;
1756 public:
1757 
1764  {
1769  TimeoutSend = OCI_NTO_SEND,
1774  TimeoutReceive = OCI_NTO_RECEIVE,
1779  TimeoutCall = OCI_NTO_CALL
1780  };
1781 
1790 
1797  {
1799  FailoverRequestSession = OCI_FOT_SESSION,
1801  FailoverRequestSelect = OCI_FOT_SELECT
1802  };
1803 
1812 
1819  {
1821  FailoverEventEnd = OCI_FOE_END,
1823  FailoverEventAbort = OCI_FOE_ABORT,
1825  FailoverEventReauthentificate = OCI_FOE_REAUTH,
1827  FailoverEventBegin = OCI_FOE_BEGIN,
1829  FailoverEventError = OCI_FOE_ERROR
1830  };
1831 
1840 
1847  {
1849  FailoverOk = OCI_FOC_OK,
1851  FailoverRetry = OCI_FOC_RETRY
1852  };
1853 
1862 
1869  {
1871  TraceIdentity = OCI_TRC_IDENTITY,
1873  TraceModule = OCI_TRC_MODULE,
1875  TraceAction = OCI_TRC_ACTION,
1877  TraceDetail = OCI_TRC_DETAIL
1878  };
1879 
1888 
1896  typedef FailoverResult(*TAFHandlerProc) (Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1897 
1903  Connection();
1904 
1918  Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1919 
1962  void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1963 
1969  void Close();
1970 
1976  void Commit();
1977 
1983  void Rollback();
1984 
1993  void Break();
1994 
2002  void SetAutoCommit(bool enabled);
2003 
2009  bool GetAutoCommit() const;
2010 
2019  bool IsServerAlive() const;
2020 
2029  bool PingServer() const;
2030 
2039  ostring GetConnectionString() const;
2040 
2049  ostring GetUserName() const;
2050 
2059  ostring GetPassword() const;
2060 
2069  ostring GetServerVersion() const;
2070 
2079  OracleVersion GetVersion() const;
2080 
2086  unsigned int GetServerMajorVersion() const;
2087 
2093  unsigned int GetServerMinorVersion() const;
2094 
2100  unsigned int GetServerRevisionVersion() const;
2101 
2109  void ChangePassword(const ostring& newPwd);
2110 
2116  ostring GetSessionTag() const;
2117 
2132  void SetSessionTag(const ostring& tag);
2133 
2139  Transaction GetTransaction() const;
2140 
2154  void SetTransaction(const Transaction &transaction);
2155 
2187  bool SetFormat(FormatType formatType, const ostring& format);
2188 
2199  ostring GetFormat(FormatType formatType);
2200 
2220  void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2221 
2230  void DisableServerOutput();
2231 
2240  bool GetServerOutput(ostring &line) const;
2241 
2247  void GetServerOutput(std::vector<ostring> &lines) const;
2248 
2277  void SetTrace(SessionTrace trace, const ostring& value);
2278 
2289  ostring GetTrace(SessionTrace trace) const;
2290 
2299  ostring GetDatabase() const;
2300 
2309  ostring GetInstance() const;
2310 
2319  ostring GetService() const;
2320 
2329  ostring GetServer() const;
2330 
2339  ostring GetDomain() const;
2340 
2349  Timestamp GetInstanceStartTime() const;
2350 
2362  unsigned int GetStatementCacheSize() const;
2363 
2374  void SetStatementCacheSize(unsigned int value);
2375 
2392  unsigned int GetDefaultLobPrefetchSize() const;
2393 
2418  void SetDefaultLobPrefetchSize(unsigned int value);
2419 
2434  unsigned int GetMaxCursors() const;
2435 
2444  bool IsTAFCapable() const;
2445 
2459  void SetTAFHandler(TAFHandlerProc handler);
2460 
2466  AnyPointer GetUserData();
2467 
2475  void SetUserData(AnyPointer value);
2476 
2490  unsigned int GetTimeout(TimeoutType timeout);
2491 
2519  void SetTimeout(TimeoutType timeout, unsigned int value);
2520 
2521 private:
2522 
2523  Connection(OCI_Connection *con, Handle *parent);
2524 };
2525 
2533 class Transaction : public HandleHolder<OCI_Transaction *>
2534 {
2535  friend class Connection;
2536 
2537 public:
2538 
2545  {
2546  Unknown = OCI_UNKNOWN,
2548  New = OCI_TRS_NEW,
2550  Tight = OCI_TRS_TIGHT,
2552  Loose = OCI_TRS_LOOSE,
2554  ReadOnly = OCI_TRS_READONLY,
2556  ReadWrite = OCI_TRS_READWRITE,
2558  Serializable = OCI_TRS_SERIALIZABLE
2559  };
2560 
2569 
2583  Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid = nullptr);
2584 
2590  void Prepare();
2591 
2597  void Start();
2598 
2604  void Stop();
2605 
2611  void Resume();
2612 
2618  void Forget();
2619 
2628  TransactionFlags GetFlags() const;
2629 
2635  unsigned int GetTimeout() const;
2636 
2637 private:
2638 
2639  Transaction(OCI_Transaction *trans);
2640 };
2641 
2652 class Number : public HandleHolder<OCI_Number *>, public Streamable
2653 {
2654  friend class Statement;
2655  friend class Resultset;
2656  friend class BindArray;
2657  friend class Object;
2658  template<class>
2659  friend class Collection;
2660 
2661 public:
2662 
2670  Number(bool create = false);
2671 
2686  Number(const otext* str, const otext* format = OTEXT(""));
2687 
2702  Number(const ostring& str, const ostring& format = OTEXT(""));
2703 
2718  void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2719 
2730  ostring ToString(const ostring& format) const;
2731 
2740  ostring ToString() const override;
2741 
2747  Number Clone() const;
2748 
2749  Number& operator ++ ();
2750  Number& operator -- ();
2751  Number operator ++ (int);
2752  Number operator -- (int);
2753 
2754  bool operator == (const Number& other) const;
2755  bool operator != (const Number& other) const;
2756  bool operator > (const Number& other) const;
2757  bool operator < (const Number& other) const;
2758  bool operator >= (const Number& other) const;
2759  bool operator <= (const Number& other) const;
2760 
2761  template<class T>
2762  Number& operator = (const T &lhs);
2763 
2764  template<class T>
2765  operator T() const;
2766 
2767  template<class T>
2768  Number operator - (const T &value);
2769 
2770  template<class T>
2771  Number operator + (const T &value);
2772 
2773  template<class T>
2774  Number operator * (const T &value);
2775 
2776  template<class T>
2777  Number operator / (const T &value);
2778 
2779  template<class T>
2780  Number& operator += (const T &value);
2781 
2782  template<class T>
2783  Number& operator -= (const T &value);
2784 
2785  template<class T>
2786  Number& operator *= (const T &value);
2787 
2788  template<class T>
2789  Number& operator /= (const T &value);
2790 
2791 private:
2792 
2793  Number(OCI_Number *pNumber, Handle *parent = nullptr);
2794 
2795  void Allocate();
2796 
2797  int Compare(const Number& other) const;
2798 
2799  template<class T>
2800  inline T GetValue() const;
2801 
2802  template<class T>
2803  Number& SetValue(const T &value);
2804 
2805  template<class T>
2806  void Add(const T &value);
2807 
2808  template<class T>
2809  void Sub(const T &value);
2810 
2811  template<class T>
2812  void Multiply(const T &value);
2813 
2814  template<class T>
2815  void Divide(const T &value);
2816 
2817  Number& operator = (OCI_Number * &lhs);
2818 };
2819 
2827 class Date : public HandleHolder<OCI_Date *>, public Streamable
2828 {
2829  friend class Statement;
2830  friend class Resultset;
2831  friend class BindArray;
2832  friend class Object;
2833  template<class>
2834  friend class Collection;
2835  friend class Message;
2836 
2837 public:
2838 
2844  static Date SysDate();
2845 
2853  Date(bool create = false);
2854 
2869  Date(const otext* str, const otext* format = OTEXT(""));
2870 
2886  Date(const ostring& str, const ostring& format = OTEXT(""));
2887 
2893  bool IsValid() const;
2894 
2900  int GetYear() const;
2901 
2907  void SetYear(int value);
2908 
2914  int GetMonth() const;
2915 
2921  void SetMonth(int value);
2922 
2928  int GetDay() const;
2929 
2935  void SetDay(int value);
2936 
2942  int GetHours() const;
2943 
2949  void SetHours(int value);
2950 
2956  int GetMinutes() const;
2957 
2963  void SetMinutes(int value);
2964 
2970  int GetSeconds() const;
2971 
2977  void SetSeconds(int value);
2978 
2986  int DaysBetween(const Date& other) const;
2987 
2997  void SetDate(int year, int month, int day);
2998 
3008  void SetTime(int hour, int min, int sec);
3009 
3022  void SetDateTime(int year, int month, int day, int hour, int min, int sec);
3023 
3033  void GetDate(int &year, int &month, int &day) const;
3034 
3044  void GetTime(int &hour, int &min, int &sec) const;
3045 
3058  void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const;
3059 
3067  void AddDays(int days);
3068 
3076  void AddMonths(int months);
3077 
3085  Date NextDay(const ostring& day) const;
3086 
3092  Date LastDay() const;
3093 
3102  void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
3103 
3118  void FromString(const ostring& str, const ostring& format = OTEXT(""));
3119 
3130  ostring ToString(const ostring& format) const;
3131 
3140  ostring ToString() const override;
3141 
3147  Date Clone() const;
3148 
3154  Date& operator ++ ();
3155 
3161  Date operator ++ (int);
3162 
3168  Date& operator -- ();
3169 
3175  Date operator -- (int);
3176 
3182  Date operator + (int value) const;
3183 
3189  Date operator - (int value) const;
3190 
3196  Date& operator += (int value);
3197 
3203  Date& operator -= (int value);
3204 
3210  bool operator == (const Date& other) const;
3211 
3217  bool operator != (const Date& other) const;
3218 
3224  bool operator > (const Date& other) const;
3225 
3231  bool operator < (const Date& other) const;
3232 
3238  bool operator >= (const Date& other) const;
3239 
3245  bool operator <= (const Date& other) const;
3246 
3247 private:
3248 
3249  int Compare(const Date& other) const;
3250 
3251  Date(OCI_Date *pDate, Handle *parent = nullptr);
3252 
3253  void Allocate();
3254 };
3255 
3263 class Interval : public HandleHolder<OCI_Interval *>, public Streamable
3264 {
3265  friend class Environment;
3266  friend class Statement;
3267  friend class Resultset;
3268  friend class BindArray;
3269  friend class Object;
3270  template<class>
3271  friend class Collection;
3272 
3273 public:
3274 
3281  {
3283  YearMonth = OCI_INTERVAL_YM,
3285  DaySecond = OCI_INTERVAL_DS
3286  };
3287 
3296 
3302  Interval();
3303 
3311  Interval(IntervalType type);
3312 
3324  Interval(IntervalType type, const ostring& data);
3325 
3331  IntervalType GetType() const;
3332 
3338  bool IsValid() const;
3339 
3348  int GetYear() const;
3349 
3358  void SetYear(int value);
3359 
3368  int GetMonth() const;
3369 
3378  void SetMonth(int value);
3379 
3388  int GetDay() const;
3389 
3398  void SetDay(int value);
3399 
3408  int GetHours() const;
3409 
3418  void SetHours(int value);
3419 
3428  int GetMinutes() const;
3429 
3438  void SetMinutes(int value);
3439 
3448  int GetSeconds() const;
3449 
3458  void SetSeconds(int value);
3459 
3465  int GetMilliSeconds() const;
3466 
3472  void SetMilliSeconds(int value);
3473 
3488  void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const;
3489 
3504  void SetDaySecond(int day, int hour, int min, int sec, int fsec);
3505 
3517  void GetYearMonth(int &year, int &month) const;
3518 
3530  void SetYearMonth(int year, int month);
3531 
3539  void UpdateTimeZone(const ostring& timeZone);
3540 
3551  void FromString(const ostring& data);
3552 
3561  ostring ToString(int leadingPrecision, int fractionPrecision) const;
3562 
3568  ostring ToString() const override;
3569 
3575  Interval Clone() const;
3576 
3582  Interval operator + (const Interval& other) const;
3583 
3589  Interval operator - (const Interval& other) const;
3590 
3596  Interval& operator += (const Interval& other);
3597 
3603  Interval& operator -= (const Interval& other);
3604 
3610  bool operator == (const Interval& other) const;
3611 
3617  bool operator != (const Interval& other) const;
3618 
3624  bool operator > (const Interval& other) const;
3625 
3631  bool operator < (const Interval& other) const;
3632 
3638  bool operator >= (const Interval& other) const;
3639 
3645  bool operator <= (const Interval& other) const;
3646 
3647 private:
3648 
3649  int Compare(const Interval& other) const;
3650 
3651  Interval(OCI_Interval *pInterval, Handle *parent = nullptr);
3652 };
3653 
3662 class Timestamp : public HandleHolder<OCI_Timestamp *>, public Streamable
3663 {
3664  friend class Environment;
3665  friend class Statement;
3666  friend class Resultset;
3667  friend class BindArray;
3668  friend class Object;
3669  friend class Connection;
3670  template<class>
3671  friend class Collection;
3672 
3673 public:
3674 
3681  {
3683  NoTimeZone = OCI_TIMESTAMP,
3685  WithTimeZone = OCI_TIMESTAMP_TZ,
3687  WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3688  };
3689 
3698 
3706  static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3707 
3713  Timestamp();
3714 
3722  Timestamp(TimestampType type);
3723 
3736  Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3737 
3743  TimestampType GetType() const;
3744 
3752  void Convert(const Timestamp& other);
3753 
3759  bool IsValid() const;
3760 
3766  int GetYear() const;
3767 
3773  void SetYear(int value);
3774 
3780  int GetMonth() const;
3781 
3787  void SetMonth(int value);
3788 
3794  int GetDay() const;
3795 
3801  void SetDay(int value);
3802 
3808  int GetHours() const;
3809 
3815  void SetHours(int value);
3816 
3822  int GetMinutes() const;
3823 
3829  void SetMinutes(int value);
3830 
3836  int GetSeconds() const;
3837 
3843  void SetSeconds(int value);
3844 
3850  int GetMilliSeconds() const;
3851 
3857  void SetMilliSeconds(int value);
3858 
3868  void GetDate(int &year, int &month, int &day) const;
3869 
3880  void GetTime(int &hour, int &min, int &sec, int &fsec) const;
3881 
3891  void SetDate(int year, int month, int day);
3892 
3903  void SetTime(int hour, int min, int sec, int fsec);
3904 
3918  void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const;
3919 
3934  void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3935 
3944  ostring GetTimeZone() const;
3945 
3955  void SetTimeZone(const ostring& timeZone);
3956 
3965  void GetTimeZoneOffset(int &hour, int &min) const;
3966 
3979  static void Substract(const Timestamp &lsh, const Timestamp &rsh, Interval &result);
3980 
3992  void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3993 
4005  ostring ToString(const ostring& format, int precision) const;
4006 
4012  ostring ToString() const override;
4013 
4019  Timestamp Clone() const;
4020 
4026  Timestamp& operator ++ ();
4027 
4033  Timestamp operator ++ (int);
4034 
4040  Timestamp& operator -- ();
4041 
4047  Timestamp operator -- (int);
4048 
4054  Timestamp operator + (int value) const;
4055 
4061  Timestamp operator - (int value) const;
4062 
4068  Interval operator - (const Timestamp& other);
4069 
4075  Timestamp& operator += (int value);
4076 
4082  Timestamp& operator -= (int value);
4083 
4089  Timestamp operator + (const Interval& other) const;
4090 
4096  Timestamp operator - (const Interval& other) const;
4097 
4103  Timestamp& operator += (const Interval& other);
4104 
4110  Timestamp& operator -= (const Interval& other);
4111 
4117  bool operator == (const Timestamp& other) const;
4118 
4124  bool operator != (const Timestamp& other) const;
4125 
4131  bool operator > (const Timestamp& other) const;
4132 
4138  bool operator < (const Timestamp& other) const;
4139 
4145  bool operator >= (const Timestamp& other) const;
4146 
4152  bool operator <= (const Timestamp& other) const;
4153 
4154 private:
4155 
4156  int Compare(const Timestamp& other) const;
4157 
4158  Timestamp(OCI_Timestamp *pTimestamp, Handle *parent = nullptr);
4159 };
4160 
4168 template<class T, int U>
4169 class Lob : public HandleHolder<OCI_Lob *>
4170 {
4171  friend class Statement;
4172  friend class Resultset;
4173  friend class BindArray;
4174  friend class Object;
4175  template<class>
4176  friend class Collection;
4177 
4178 public:
4179 
4185  Lob();
4186 
4197  Lob(const Connection &connection);
4198 
4209  T Read(unsigned int length);
4210 
4221  unsigned int Write(const T &content);
4222 
4233  unsigned int Append(const T& content);
4234 
4242  void Append(const Lob& other);
4243 
4258  bool Seek(SeekMode seekMode, big_uint offset);
4259 
4265  LobType GetType() const;
4266 
4272  big_uint GetOffset() const;
4273 
4279  big_uint GetLength() const;
4280 
4286  big_uint GetMaxSize() const;
4287 
4299  big_uint GetChunkSize() const;
4300 
4306  Connection GetConnection() const;
4307 
4315  void Truncate(big_uint length);
4316 
4332  big_uint Erase(big_uint offset, big_uint length);
4333 
4347  void Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4348 
4354  bool IsTemporary() const;
4355 
4361  bool IsRemote() const;
4362 
4375  void Open(OpenMode mode);
4376 
4382  void Flush();
4383 
4392  void Close();
4393 
4412  void EnableBuffering(bool value);
4413 
4419  Lob Clone() const;
4420 
4426  Lob& operator += (const Lob& other);
4427 
4433  bool operator == (const Lob& other) const;
4434 
4440  bool operator != (const Lob& other) const;
4441 
4442 private:
4443 
4444  bool Equals(const Lob &other) const;
4445 
4446  Lob(OCI_Lob *pLob, Handle *parent = nullptr);
4447 
4448 };
4449 
4460 
4471 
4482 
4491 class File : public HandleHolder<OCI_File *>
4492 {
4493  friend class Statement;
4494  friend class Resultset;
4495  friend class BindArray;
4496  friend class Object;
4497  template<class>
4498  friend class Collection;
4499 
4500 public:
4501 
4507  File();
4508 
4519  File(const Connection &connection);
4520 
4535  File(const Connection &connection, const ostring& directory, const ostring& name);
4536 
4547  Raw Read(unsigned int size);
4548 
4563  bool Seek(SeekMode seekMode, big_uint offset);
4564 
4573  bool Exists() const;
4574 
4580  big_uint GetOffset() const;
4581 
4587  big_uint GetLength() const;
4588 
4594  Connection GetConnection() const;
4595 
4608  void SetInfos(const ostring& directory, const ostring& name);
4609 
4615  ostring GetName() const;
4616 
4622  ostring GetDirectory() const;
4623 
4629  void Open();
4630 
4636  void Close();
4637 
4643  bool IsOpened() const;
4644 
4650  File Clone() const;
4651 
4657  bool operator == (const File& other) const;
4658 
4664  bool operator != (const File& other) const;
4665 
4666 private:
4667 
4668  bool Equals(const File &other) const;
4669 
4670  File(OCI_File *pFile, Handle *parent = nullptr);
4671 };
4672 
4680 class TypeInfo : public HandleHolder<OCI_TypeInfo *>
4681 {
4682  friend class Object;
4683  friend class Reference;
4684  template<class>
4685  friend class Collection;
4686  friend class Column;
4687 public:
4688 
4695  {
4697  Table = OCI_TIF_TABLE,
4699  View = OCI_TIF_VIEW,
4701  Type = OCI_TIF_TYPE
4702  };
4703 
4712 
4725  TypeInfo(const Connection &connection, const ostring& name, TypeInfoType type);
4726 
4732  TypeInfoType GetType() const;
4733 
4739  ostring GetName() const;
4740 
4746  Connection GetConnection() const;
4747 
4757  unsigned int GetColumnCount() const;
4758 
4773  Column GetColumn(unsigned int index) const;
4774 
4787  boolean IsFinalType() const;
4788 
4803  TypeInfo GetSuperType() const;
4804 
4805 private:
4806 
4807  TypeInfo(OCI_TypeInfo *pTypeInfo);
4808 };
4809 
4817 class Object : public HandleHolder<OCI_Object *>, public Streamable
4818 {
4819  friend class Statement;
4820  friend class Resultset;
4821  friend class BindArray;
4822  friend class Reference;
4823  template<class>
4824  friend class Collection;
4825  friend class Message;
4826 
4827 public:
4828 
4835  {
4837  Persistent = OCI_OBJ_PERSISTENT,
4839  Transient = OCI_OBJ_TRANSIENT,
4841  Value = OCI_OBJ_VALUE
4842  };
4843 
4852 
4858  Object();
4859 
4867  Object(const TypeInfo &typeInfo);
4868 
4876  bool IsAttributeNull(const ostring& name) const;
4877 
4885  void SetAttributeNull(const ostring& name);
4886 
4892  TypeInfo GetTypeInfo() const;
4893 
4899  Reference GetReference() const;
4900 
4906  ObjectType GetType() const;
4907 
4920  template<class T>
4921  T Get(const ostring& name) const;
4922 
4936  template<class T>
4937  void Get(const ostring& name, T &value) const;
4938 
4952  template<class T>
4953  void Get(const ostring& name, Collection<T> &value) const;
4954 
4968  template<class T>
4969  void Set(const ostring& name, const T &value);
4970 
4976  Object Clone() const;
4977 
4983  ostring ToString() const;
4984 
4985 private:
4986 
4987  Object(OCI_Object *pObject, Handle *parent = nullptr);
4988 };
4989 
4997 class Reference : public HandleHolder<OCI_Ref *>, public Streamable
4998 {
4999  friend class Statement;
5000  friend class Resultset;
5001  friend class BindArray;
5002  friend class Object;
5003  template<class>
5004  friend class Collection;
5005 
5006 public:
5007 
5013  Reference();
5014 
5022  Reference(const TypeInfo &typeInfo);
5023 
5029  TypeInfo GetTypeInfo() const;
5030 
5039  Object GetObject() const;
5040 
5046  bool IsReferenceNull() const;
5047 
5056  void SetReferenceNull();
5057 
5063  Reference Clone() const;
5064 
5070  ostring ToString() const override;
5071 
5072 private:
5073 
5074  Reference(OCI_Ref *pRef, Handle *parent = nullptr);
5075 };
5076 
5085 template<class T>
5087 {
5088  template<class>
5089  friend class CollectionIterator;
5090 
5091 public:
5092 
5093  typedef T ValueType;
5095 
5097  CollectionElement(CollectionType *coll, unsigned int pos);
5098  operator T() const;
5099  CollectionElement& operator = (const ValueType& value);
5100  CollectionElement& operator = (const CollectionElement& other);
5101  bool IsNull() const;
5102  void SetNull();
5103 
5104 private:
5105 
5106  CollectionType* _coll;
5107  unsigned int _pos;
5108 };
5109 
5117 template<class T>
5119 {
5120 public:
5121 
5122  template<class>
5123  friend class Collection;
5124 
5125  typedef typename T::ValueType value_type;
5127 
5128  typedef std::random_access_iterator_tag iterator_category;
5129  typedef ptrdiff_t difference_type;
5130  typedef ptrdiff_t distance_type;
5131  typedef value_type* pointer;
5132  typedef value_type& reference;
5133 
5135  CollectionIterator(const CollectionIterator& other);
5136 
5137  CollectionIterator& operator = (const CollectionIterator& other);
5138  CollectionIterator& operator += (difference_type value);
5139  CollectionIterator& operator -= (difference_type value);
5140 
5141  T& operator*();
5142  T* operator->();
5143 
5144  CollectionIterator& operator++();
5145  CollectionIterator& operator--();
5146 
5147  CollectionIterator operator++(int);
5148  CollectionIterator operator--(int);
5149 
5150  CollectionIterator operator + (difference_type value);
5151  CollectionIterator operator - (difference_type value);
5152 
5153  difference_type operator - (const CollectionIterator &other);
5154 
5155  bool operator == (const CollectionIterator& other);
5156  bool operator != (const CollectionIterator& other);
5157  bool operator > (const CollectionIterator& other);
5158  bool operator < (const CollectionIterator& other);
5159  bool operator >= (const CollectionIterator& other);
5160  bool operator <= (const CollectionIterator& other);
5161 
5162 protected:
5163 
5164  CollectionIterator(CollectionType *collection, unsigned int pos);
5165 
5166  T _elem;
5167 };
5168 
5176 template<class T>
5177 class Collection : public HandleHolder<OCI_Coll *>, public Streamable
5178 {
5179  friend class Statement;
5180  friend class Resultset;
5181  friend class BindArray;
5182  friend class Object;
5183  template<class>
5184  friend class CollectionIterator;
5185  template<class>
5186  friend class Collection;
5187 
5188 public:
5189 
5196  {
5198  Varray = OCI_COLL_VARRAY,
5200  NestedTable = OCI_COLL_NESTED_TABLE,
5202  IndexedTable = OCI_COLL_INDEXED_TABLE
5203  };
5204 
5213 
5219  Collection();
5220 
5228  Collection(const TypeInfo &typeInfo);
5229 
5235  CollectionType GetType() const;
5236 
5242  unsigned int GetMax() const;
5243 
5249  unsigned int GetSize() const;
5250 
5261  unsigned int GetCount() const;
5262 
5270  void Truncate(unsigned int size);
5271 
5278  void Clear();
5279 
5290  bool IsElementNull(unsigned int index) const;
5291 
5302  void SetElementNull(unsigned int index);
5303 
5321  bool Delete(unsigned int index) const;
5322 
5330  T Get(unsigned int index) const;
5331 
5340  void Set(unsigned int index, const T &value);
5341 
5350  void Append(const T &data);
5351 
5357  TypeInfo GetTypeInfo() const;
5358 
5364  Collection Clone() const;
5365 
5371  ostring ToString() const override;
5372 
5379 
5386 
5392  iterator begin();
5393 
5399  const_iterator begin() const;
5400 
5406  iterator end();
5407 
5413  const_iterator end() const;
5414 
5420  CollectionElement<T> operator [] (unsigned int index);
5421 
5427  const CollectionElement<T> operator [] (unsigned int index) const;
5428 
5429 private:
5430 
5431  static T GetElem(OCI_Elem *elem, Handle *parent);
5432 
5433  static void SetElem(OCI_Elem *elem, const T &value);
5434 
5435  Collection(OCI_Coll *pColl, Handle *parent = nullptr);
5436 };
5437 
5445 template<class T, int U>
5446 class Long : public HandleHolder<OCI_Long *>
5447 {
5448  friend class Statement;
5449  friend class Resultset;
5450  friend class BindArray;
5451 
5452 public:
5453 
5459  Long();
5460 
5468  Long(const Statement &statement);
5469 
5480  unsigned int Write(const T& content);
5481 
5487  unsigned int GetLength() const;
5488 
5494  T GetContent() const;
5495 
5496 private:
5497 
5498  Long(OCI_Long *pLong, Handle *parent = nullptr);
5499 };
5500 
5508 class BindInfo : public HandleHolder<OCI_Bind *>
5509 {
5510  friend class Statement;
5511 
5512 public:
5513 
5520  {
5522  In = OCI_BDM_IN,
5524  Out = OCI_BDM_OUT,
5526  InOut = OCI_BDM_IN_OUT
5527  };
5528 
5537 
5544  {
5546  AsArray = 1,
5548  AsPlSqlTable = 2
5549  };
5550 
5559 
5565  ostring GetName() const;
5566 
5572  DataType GetType() const;
5573 
5593  unsigned int GetSubType() const;
5594 
5604  unsigned int GetDataCount() const;
5605 
5611  Statement GetStatement() const;
5612 
5633  void SetDataNull(bool value, unsigned int index = 1);
5634 
5649  bool IsDataNull(unsigned int index = 1) const;
5650 
5664  void SetCharsetForm(CharsetForm value);
5665 
5671  BindDirection GetDirection() const;
5672 
5673 private:
5674 
5675  BindInfo(OCI_Bind *pBind, Handle *parent);
5676 };
5677 
5685 class Statement : public HandleHolder<OCI_Statement *>
5686 {
5687  friend class Exception;
5688  friend class Resultset;
5689  template<class, int>
5690  friend class Long;
5691  friend class BindInfo;
5692  friend class BindObject;
5693 
5694 public:
5695 
5702  {
5704  TypeSelect = OCI_CST_SELECT,
5706  TypeUpdate = OCI_CST_UPDATE,
5708  TypeDelete = OCI_CST_DELETE,
5710  TypeInsert = OCI_CST_INSERT,
5712  TypeCreate = OCI_CST_CREATE,
5714  TypeDrop = OCI_CST_DROP,
5716  TypeAlter = OCI_CST_ALTER,
5718  TypeBegin = OCI_CST_BEGIN,
5720  TypeDeclare = OCI_CST_DECLARE,
5722  TypeCall = OCI_CST_CALL,
5724  TypeMerge = OCI_CST_MERGE
5725  };
5726 
5735 
5742  {
5744  FetchForward = OCI_SFM_DEFAULT,
5746  FetchScrollable = OCI_SFM_SCROLLABLE
5747  };
5748 
5757 
5764  {
5766  BindByPosition = OCI_BIND_BY_POS,
5768  BindByName = OCI_BIND_BY_NAME
5769  };
5770 
5779 
5786  {
5788  LongExplicit = OCI_LONG_EXPLICIT,
5790  LongImplicit = OCI_LONG_IMPLICIT
5791  };
5792 
5801 
5807  Statement();
5808 
5819  Statement(const Connection &connection);
5820 
5826  Connection GetConnection() const;
5827 
5854  void Describe(const ostring& sql);
5855 
5879  void Parse(const ostring& sql);
5880 
5891  void Prepare(const ostring& sql);
5892 
5898  void ExecutePrepared();
5899 
5907  void Execute(const ostring& sql);
5908 
5926  template<class T>
5927  unsigned int ExecutePrepared(T callback);
5928 
5949  template<class T, class U>
5950  unsigned int ExecutePrepared(T callback, U adapter);
5951 
5970  template<class T>
5971  unsigned int Execute(const ostring& sql, T callback);
5972 
5994  template<class T, class U>
5995  unsigned int Execute(const ostring& sql, T callback, U adapter);
5996 
6011  unsigned int GetAffectedRows() const;
6012 
6018  ostring GetSql() const;
6019 
6025  ostring GetSqlIdentifier() const;
6026 
6038  Resultset GetResultset();
6039 
6061  Resultset GetNextResultset();
6062 
6087  void SetBindArraySize(unsigned int size);
6088 
6094  unsigned int GetBindArraySize() const;
6095 
6111  void AllowRebinding(bool value);
6112 
6121  bool IsRebindingAllowed() const;
6122 
6139  unsigned int GetBindIndex(const ostring& name) const;
6140 
6146  unsigned int GetBindCount() const;
6147 
6162  BindInfo GetBind(unsigned int index) const;
6163 
6174  BindInfo GetBind(const ostring& name) const;
6175 
6195  template<class T>
6196  void Bind(const ostring& name, T &value, BindInfo::BindDirection mode);
6197 
6219  template<class T, class U>
6220  void Bind(const ostring& name, T &value,U extraInfo, BindInfo::BindDirection mode);
6221 
6233  template<class T>
6234  void Bind(const ostring& name, Collection<T> &value, BindInfo::BindDirection mode);
6235 
6256  template<class T>
6257  void Bind(const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6258 
6279  template<class T>
6280  void Bind(const ostring& name, std::vector<T> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6281 
6295  template<class T>
6296  void Bind(const ostring& name, std::vector<Collection<T> > &values, TypeInfo &typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6297 
6321  template<class T, class U>
6322  void Bind(const ostring& name, std::vector<T> &values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6323 
6344  template<class T>
6345  void Register(const ostring& name);
6346 
6364  template<class T, class U>
6365  void Register(const ostring& name, U& extraInfo);
6366 
6385  template<class T, class U>
6386  void Register(const ostring& name, U extraInfo);
6387 
6393  StatementType GetStatementType() const;
6394 
6404  unsigned int GetSqlErrorPos() const;
6405 
6416  void SetFetchMode(FetchMode value);
6417 
6426  FetchMode GetFetchMode() const;
6427 
6435  void SetBindMode(BindMode value);
6436 
6445  BindMode GetBindMode() const;
6446 
6454  void SetFetchSize(unsigned int value);
6455 
6464  unsigned int GetFetchSize() const;
6465 
6476  void SetPrefetchSize(unsigned int value);
6477 
6486  unsigned int GetPrefetchSize() const;
6487 
6506  void SetPrefetchMemory(unsigned int value);
6507 
6516  unsigned int GetPrefetchMemory() const;
6517 
6525  void SetLongMaxSize(unsigned int value);
6526 
6535  unsigned int GetLongMaxSize() const;
6536 
6547  void SetLongMode(LongMode value);
6548 
6554  LongMode GetLongMode() const;
6555 
6568  unsigned int GetSQLCommand() const;
6569 
6582  ostring GetSQLVerb() const;
6583 
6589  void GetBatchErrors(std::vector<Exception> &exceptions);
6590 
6591 private:
6592 
6593  static bool IsResultsetHandle(Handle *handle);
6594  static void OnFreeSmartHandle(SmartHandle *smartHandle);
6595 
6596  Statement(OCI_Statement *stmt, Handle *parent = nullptr);
6597 
6598  BindsHolder *GetBindsHolder(bool allocate) const;
6599 
6600  void ReleaseResultsets() const;
6601 
6602  void SetLastBindMode(BindInfo::BindDirection mode);
6603 
6604  void SetInData() const;
6605  void SetOutData() const;
6606  void ClearBinds() const;
6607 
6608  template<typename M, class T>
6609  void Bind1 (M &method, const ostring& name, T& value, BindInfo::BindDirection mode);
6610 
6611  template<typename M, class T>
6612  void Bind2 (M &method, const ostring& name, T &value, BindInfo::BindDirection mode);
6613 
6614  template<typename M, class T>
6615  void BindVector1(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, BindInfo::VectorType type);
6616 
6617  template<typename M, class T, class U>
6618  void BindVector2(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, U subType, BindInfo::VectorType type);
6619 
6620  template<class T>
6621  unsigned int GetArraysize(BindInfo::VectorType type, std::vector<T> &values);
6622 
6623  template<typename T>
6624  unsigned int Fetch(T callback);
6625 
6626  template<typename T, typename U>
6627  unsigned int Fetch(T callback, U adapter);
6628 };
6629 
6637 class Resultset : public HandleHolder<OCI_Resultset *>
6638 {
6639  friend class Statement;
6640 public:
6641 
6648  {
6650  SeekAbsolute = OCI_SFD_ABSOLUTE,
6652  SeekRelative = OCI_SFD_RELATIVE
6653  };
6654 
6663 
6676  template<class T>
6677  T Get(unsigned int index) const;
6678 
6692  template<class T>
6693  void Get(unsigned int index, T &value) const;
6694 
6707  template<class T>
6708  T Get(const ostring& name) const;
6709 
6720  template<class T>
6721  void Get(const ostring &name, T &value) const;
6722 
6737  template<class T, class U>
6738  bool Get(T& value, U adapter) const;
6739 
6755  template<typename T>
6756  unsigned int ForEach(T callback);
6757 
6780  template<typename T, typename U>
6781  unsigned int ForEach(T callback, U adapter);
6782 
6796  bool Next();
6797 
6811  bool Prev();
6812 
6824  bool First();
6825 
6837  bool Last();
6838 
6859  bool Seek(SeekMode mode, int offset);
6860 
6866  unsigned int GetCount() const;
6867 
6878  unsigned int GetCurrentRow() const;
6879 
6893  unsigned int GetColumnIndex(const ostring& name) const;
6894 
6900  unsigned int GetColumnCount() const;
6901 
6912  Column GetColumn(unsigned int index) const;
6913 
6924  Column GetColumn(const ostring& name) const;
6925 
6936  bool IsColumnNull(unsigned int index) const;
6937 
6945  bool IsColumnNull(const ostring& name) const;
6946 
6952  Statement GetStatement() const;
6953 
6959  bool operator ++ (int);
6960 
6966  bool operator -- (int);
6967 
6974  bool operator += (int offset);
6975 
6982  bool operator -= (int offset);
6983 
6984 private:
6985 
6986  Resultset(OCI_Resultset *resultset, Handle *parent);
6987 };
6988 
6996 class Column : public HandleHolder<OCI_Column *>
6997 {
6998  friend class TypeInfo;
6999  friend class Resultset;
7000 
7001 public:
7002 
7009  {
7011  NoFlags = OCI_CPF_NONE,
7014  IsIdentity = OCI_CPF_IS_IDENTITY,
7018  IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
7021  IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
7023  IsLogicalPartitioning = OCI_CPF_IS_LPART,
7025  IsGeneratedByContainers = OCI_CPF_IS_CONID
7026  };
7027 
7036 
7042  ostring GetName() const;
7043 
7052  ostring GetSQLType() const;
7053 
7063  ostring GetFullSQLType() const;
7064 
7070  DataType GetType() const;
7071 
7089  unsigned int GetSubType() const;
7090 
7096  CharsetForm GetCharsetForm() const;
7097 
7103  CollationID GetCollationID() const;
7104 
7114  unsigned int GetSize() const;
7115 
7121  int GetScale() const;
7122 
7128  int GetPrecision() const;
7129 
7135  int GetFractionalPrecision() const;
7136 
7142  int GetLeadingPrecision() const;
7143 
7154  PropertyFlags GetPropertyFlags() const;
7155 
7161  bool IsNullable() const;
7162 
7172  bool IsCharSemanticUsed() const;
7173 
7183  TypeInfo GetTypeInfo() const;
7184 
7185 private:
7186 
7187  Column(OCI_Column *pColumn, Handle *parent);
7188 };
7189 
7200 class Subscription : public HandleHolder<OCI_Subscription *>
7201 {
7202  friend class Event;
7203 
7204 public:
7205 
7213  typedef void (*NotifyHandlerProc) (Event &evt);
7214 
7221  {
7223  ObjectChanges = OCI_CNT_OBJECTS,
7225  RowChanges = OCI_CNT_ROWS,
7227  DatabaseChanges = OCI_CNT_DATABASES,
7229  AllChanges = OCI_CNT_ALL
7230  };
7231 
7240 
7246  Subscription();
7247 
7263  void Register(const Connection &connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7264 
7279  void Unregister();
7280 
7286  void Watch(const ostring& sql);
7287 
7293  ostring GetName() const;
7294 
7300  unsigned int GetTimeout() const;
7301 
7307  unsigned int GetPort() const;
7308 
7317  Connection GetConnection() const;
7318 
7319 private:
7320 
7321  Subscription(OCI_Subscription *pSubcription);
7322 };
7323 
7334 class Event : public HandleHolder<OCI_Event *>
7335 {
7336  friend class Subscription;
7337  friend class Environment;
7338 
7339 public:
7340 
7347  {
7349  DatabaseStart = OCI_ENT_STARTUP,
7351  DatabaseShutdown = OCI_ENT_SHUTDOWN,
7353  DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7355  DatabaseDrop = OCI_ENT_DROP_DATABASE,
7357  Unregister = OCI_ENT_DEREGISTER,
7359  ObjectChanged = OCI_ENT_OBJECT_CHANGED
7360  };
7361 
7370 
7377  {
7379  ObjectInserted = OCI_ONT_INSERT,
7381  ObjectUpdated = OCI_ONT_UPDATE,
7383  ObjectDeleted = OCI_ONT_DELETE,
7385  ObjectAltered = OCI_ONT_ALTER,
7387  ObjectDropped = OCI_ONT_DROP,
7389  ObjectGeneric = OCI_ONT_GENERIC
7390  };
7391 
7400 
7406  EventType GetType() const;
7407 
7416  ObjectEvent GetObjectEvent() const;
7417 
7423  ostring GetDatabaseName() const;
7424 
7433  ostring GetObjectName() const;
7434 
7440  ostring GetRowID() const;
7441 
7447  Subscription GetSubscription() const;
7448 
7449 private:
7450 
7451  Event(OCI_Event *pEvent);
7452 };
7453 
7461 class Agent : public HandleHolder<OCI_Agent *>
7462 {
7463  friend class Message;
7464  friend class Dequeue;
7465 
7466 public:
7467 
7490  Agent(const Connection &connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7491 
7497  ostring GetName() const;
7498 
7512  void SetName(const ostring& value);
7513 
7522  ostring GetAddress() const;
7523 
7537  void SetAddress(const ostring& value);
7538 
7539 private:
7540 
7541  Agent(OCI_Agent *pAgent, Handle *parent);
7542 };
7543 
7551 class Message : public HandleHolder<OCI_Msg *>
7552 {
7553  friend class Dequeue;
7554 
7555 public:
7556 
7563  {
7565  Ready = OCI_AMS_READY,
7567  Waiting = OCI_AMS_WAITING,
7569  Processed = OCI_AMS_PROCESSED,
7571  Expired = OCI_AMS_EXPIRED
7572  };
7573 
7582 
7612  Message(const TypeInfo &typeInfo);
7613 
7622  void Reset();
7623 
7629  template<class T>
7630  T GetPayload();
7631 
7639  template<class T>
7640  void SetPayload(const T &value);
7641 
7650  Date GetEnqueueTime() const;
7651 
7657  int GetAttemptCount() const;
7658 
7664  MessageState GetState() const;
7665 
7676  Raw GetID() const;
7677 
7686  int GetExpiration() const;
7687 
7707  void SetExpiration(int value);
7708 
7717  int GetEnqueueDelay() const;
7718 
7741  void SetEnqueueDelay(int value);
7742 
7751  int GetPriority() const;
7752 
7765  void SetPriority(int value);
7766 
7776  Raw GetOriginalID() const;
7777 
7789  void SetOriginalID(const Raw &value);
7790 
7799  ostring GetCorrelation() const;
7800 
7811  void SetCorrelation(const ostring& value);
7812 
7826  ostring GetExceptionQueue() const;
7827 
7854  void SetExceptionQueue(const ostring& value);
7855 
7864  Agent GetSender() const;
7865 
7873  void SetSender(const Agent &agent);
7874 
7886  void SetConsumers(std::vector<Agent> &agents);
7887 
7888 private:
7889 
7890  Message(OCI_Msg *pMessage, Handle *parent);
7891 };
7892 
7900 class Enqueue : public HandleHolder<OCI_Enqueue *>
7901 {
7902 public:
7903 
7910  {
7912  Before = OCI_ASD_BEFORE,
7914  OnTop = OCI_ASD_TOP
7915  };
7916 
7925 
7932  {
7934  Immediate = OCI_AMV_IMMEDIATE,
7936  OnCommit = OCI_AMV_ON_COMMIT
7937  };
7938 
7947 
7969  Enqueue(const TypeInfo &typeInfo, const ostring& queueName);
7970 
7978  void Put(const Message &message);
7979 
7988  EnqueueVisibility GetVisibility() const;
7989 
8000  void SetVisibility(EnqueueVisibility value);
8001 
8010  EnqueueMode GetMode() const;
8011 
8030  void SetMode(EnqueueMode value);
8031 
8042  Raw GetRelativeMsgID() const;
8043 
8057  void SetRelativeMsgID(const Raw &value);
8058 };
8059 
8067 class Dequeue : public HandleHolder<OCI_Dequeue *>
8068 {
8069  friend class Environment;
8070 
8071 public:
8072 
8080  typedef void (*NotifyAQHandlerProc) (Dequeue &dequeue);
8081 
8088  {
8090  Browse = OCI_ADM_BROWSE,
8092  Locked = OCI_ADM_LOCKED,
8094  Remove = OCI_ADM_REMOVE,
8096  Confirm = OCI_ADM_REMOVE_NODATA
8097  };
8098 
8107 
8114  {
8116  Immediate = OCI_AMV_IMMEDIATE,
8118  OnCommit = OCI_AMV_ON_COMMIT
8119  };
8120 
8129 
8136  {
8138  FirstMessage = OCI_ADN_FIRST_MSG,
8140  NextMessage = OCI_ADN_NEXT_MSG,
8143  NextTransaction = OCI_ADN_NEXT_TRANSACTION
8144  };
8145 
8154 
8163  Dequeue(const TypeInfo &typeInfo, const ostring& queueName);
8164 
8178  Message Get();
8179 
8195  Agent Listen(int timeout);
8196 
8205  ostring GetConsumer() const;
8206 
8218  void SetConsumer(const ostring& value);
8219 
8228  ostring GetCorrelation() const;
8229 
8241  void SetCorrelation(const ostring& value);
8242 
8251  Raw GetRelativeMsgID() const;
8252 
8260  void SetRelativeMsgID(const Raw &value);
8261 
8270  DequeueVisibility GetVisibility() const;
8271 
8286  void SetVisibility(DequeueVisibility value);
8287 
8296  DequeueMode GetMode() const;
8297 
8308  void SetMode(DequeueMode value);
8309 
8318  NavigationMode GetNavigation() const;
8319 
8339  void SetNavigation(NavigationMode value);
8340 
8349  int GetWaitTime() const;
8350 
8368  void SetWaitTime(int value);
8369 
8377  void SetAgents(std::vector<Agent> &agents);
8378 
8395  void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8396 
8405  void Unsubscribe();
8406 
8407 private:
8408 
8409  Dequeue(OCI_Dequeue *pDequeue);
8410 };
8411 
8417 class Queue
8418 {
8419 public:
8420 
8427  {
8429  NormalQueue = OCI_AQT_NORMAL,
8431  ExceptionQueue = OCI_AQT_EXCEPTION,
8433  NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8434  };
8435 
8444 
8469  static void Create(const Connection &connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8470  unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8471  bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8472 
8493  static void Alter(const Connection &connection, const ostring& queue,
8494  unsigned int maxRetries= 0, unsigned int retryDelay= 0,
8495  unsigned int retentionTime= 0, const ostring& comment = OTEXT(""));
8496 
8512  static void Drop(const Connection &connection, const ostring& queue);
8513 
8531  static void Start(const Connection &connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8532 
8551  static void Stop(const Connection &connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8552 };
8553 
8560 {
8561 public:
8562 
8570  {
8572  None = OCI_AGM_NONE,
8575  Transactionnal = OCI_AGM_TRANSACTIONNAL
8576  };
8577 
8586 
8594  {
8596  Buffered = OCI_APM_BUFFERED,
8598  Persistent = OCI_APM_PERSISTENT,
8600  All = OCI_APM_ALL
8601  };
8602 
8611 
8646  static void Create(const Connection &connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8647  const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8648  GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8649  unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8650  const ostring& compatible = OTEXT(""));
8651 
8670  static void Alter(const Connection &connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8671 
8692  static void Drop(const Connection &connection, const ostring& table, bool force = true);
8693 
8717  static void Purge(const Connection &connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8718 
8736  static void Migrate(const Connection &connection, const ostring& table, const ostring& compatible = OTEXT(""));
8737 };
8738 
8746 class DirectPath : public HandleHolder<OCI_DirPath *>
8747 {
8748 public:
8749 
8756  {
8758  Default = OCI_DCM_DEFAULT,
8760  Force = OCI_DCM_FORCE
8761  };
8762 
8771 
8778  {
8780  ResultComplete = OCI_DPR_COMPLETE,
8782  ResultError = OCI_DPR_ERROR,
8784  ResultFull = OCI_DPR_FULL ,
8786  ResultPartial = OCI_DPR_PARTIAL,
8788  ResultEmpty = OCI_DPR_EMPTY
8789  };
8790 
8799 
8821  DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8822 
8839  void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8840 
8871  template<class T>
8872  void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8873 
8884  void Reset();
8885 
8891  void Prepare();
8892 
8911  DirectPath::Result Convert();
8912 
8924  DirectPath::Result Load();
8925 
8934  void Finish();
8935 
8948  void Abort();
8949 
8958  void Save();
8959 
8965  void FlushRow();
8966 
8978  void SetCurrentRows(unsigned int value);
8979 
8988  unsigned int GetCurrentRows() const;
8989 
8998  unsigned int GetMaxRows() const;
8999 
9008  unsigned int GetRowCount() const;
9009 
9022  unsigned int GetAffectedRows() const;
9023 
9037  void SetDateFormat(const ostring& format);
9038 
9065  void SetParallel(bool value);
9066 
9081  void SetNoLog(bool value);
9082 
9096  void SetCacheSize(unsigned int value);
9097 
9108  void SetBufferSize(unsigned int value);
9109 
9123  void SetConversionMode(ConversionMode value);
9124 
9153  unsigned int GetErrorColumn();
9154 
9188  unsigned int GetErrorRow();
9189 };
9190 
9191 }
9192 
9193 #include "ocilib_impl.hpp"
9194 
9195 #endif
9196 
struct OCI_Mutex OCI_Mutex
OCILIB encapsulation of OCI mutexes.
Definition: ocilib.h:699
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: ocilib.h:759
CharsetModeValues
Charset mode enumerated values.
Definition: ocilib.hpp:776
Encapsulate a Resultset column or object member properties.
Definition: ocilib.hpp:6996
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: ocilib.hpp:4481
DequeueVisibilityValues
Message visibility enumerated values.
Definition: ocilib.hpp:8113
STL compliant Collection Random iterator class.
Definition: ocilib.hpp:5118
Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: ocilib.hpp:829
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: ocilib.h:423
Static class allowing to set/get thread local storage (TLS) values for a given unique key...
Definition: ocilib.hpp:1454
Exception class handling all OCILIB errors.
Definition: ocilib.hpp:534
Provides SQL bind informations.
Definition: ocilib.hpp:5508
TypeInfoTypeValues
Type of object information enumerated values.
Definition: ocilib.hpp:4694
EventTypeValues
Event type enumerated values.
Definition: ocilib.hpp:7346
LobTypeValues
Lob types enumerated values.
Definition: ocilib.hpp:457
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: ocilib.hpp:5385
Enum< BindModeValues > BindMode
Bind Modes.
Definition: ocilib.hpp:5778
OCILIB ++ Namespace.
HAEventSourceValues
HA Event sources enumerated values.
Definition: ocilib.hpp:676
Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: ocilib.hpp:8106
Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: ocilib.hpp:1534
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: ocilib.hpp:359
FetchModeValues
Fetch Modes enumerated values.
Definition: ocilib.hpp:5741
TimeoutTypeValues
Timeout enumerated values.
Definition: ocilib.hpp:1763
HAEventTypeValues
HA Event types enumerated values.
Definition: ocilib.hpp:708
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Class allowing the administration of Oracle Queues.
Definition: ocilib.hpp:8417
SessionTraceValues
Session trace enumerated values.
Definition: ocilib.hpp:1868
Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: ocilib.hpp:8585
Subscription Event.
Definition: ocilib.hpp:7334
StatementTypeValues
Statement Type enumerated values.
Definition: ocilib.hpp:5701
Enum< LobTypeValues > LobType
Type of Lob.
Definition: ocilib.hpp:474
Enum< DataTypeValues > DataType
Column data type.
Definition: ocilib.hpp:301
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: ocilib.hpp:187
struct OCI_XID OCI_XID
Global transaction identifier.
ostring GetMessage() const
Retrieve the error message.
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: ocilib.hpp:5685
A connection or session with a specific database.
Definition: ocilib.hpp:1738
Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: ocilib.hpp:7035
static class allowing to manipulate threads
Definition: ocilib.hpp:1329
PoolTypeValues
Pool type enumerated values.
Definition: ocilib.hpp:1519
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Definition: ocilib.h:598
Object identifying the SQL data type LONG.
Definition: ocilib.hpp:5446
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
Definition: ocilib.h:769
int GetOracleErrorCode() const
Return the Oracle error code.
Oracle Transaction object.
Definition: ocilib.hpp:2533
FailoverResultValues
Failover callback results enumerated values.
Definition: ocilib.hpp:1846
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: ocilib.h:435
struct OCI_Bind OCI_Bind
Internal bind representation.
Definition: ocilib.h:447
STL namespace.
Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: ocilib.hpp:4851
LongTypeValues
Long types enumerated values.
Definition: ocilib.hpp:481
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Definition: ocilib.h:729
TimestampTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3680
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: ocilib.hpp:862
Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: ocilib.hpp:942
AQ identified agent for messages delivery.
Definition: ocilib.hpp:7461
Static class allowing managing mutexes.
Definition: ocilib.hpp:1402
Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: ocilib.hpp:8128
Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: ocilib.hpp:255
Oracle Direct path loading encapsulation.
Definition: ocilib.hpp:8746
Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: ocilib.hpp:7946
Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: ocilib.hpp:8153
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Definition: ocilib.h:588
Enum< EventTypeValues > EventType
Event type.
Definition: ocilib.hpp:7369
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: ocilib.hpp:7909
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
Definition: ocilib.h:808
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Definition: ocilib.hpp:7239
Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: ocilib.hpp:564
ConversionModeValues
Conversion mode enumerated values.
Definition: ocilib.hpp:8755
VectorTypeValues
Vector type values.
Definition: ocilib.hpp:5543
Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: ocilib.hpp:905
Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: ocilib.hpp:747
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: ocilib.hpp:886
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
Definition: ocilib.h:749
const void * ThreadId
Thread Unique ID.
Definition: ocilib.hpp:205
Object identifying the SQL data type REF.
Definition: ocilib.hpp:4997
Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: ocilib.hpp:3295
SeekModeValues
Seek Modes enumerated values.
Definition: ocilib.hpp:411
Enum< StatementTypeValues > StatementType
Statement Type.
Definition: ocilib.hpp:5734
PurgeModeValues
Purge mode enumerated values.
Definition: ocilib.hpp:8593
Static class in charge of library initialization / cleanup.
Definition: ocilib.hpp:659
FailoverRequestValues
Failover request enumerated values.
Definition: ocilib.hpp:1796
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
Definition: ocilib.hpp:5086
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: ocilib.hpp:949
Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: ocilib.hpp:7399
FailoverEventValues
Failover events enumerated values.
Definition: ocilib.hpp:1818
Enum< VectorTypeValues > VectorType
Vector type.
Definition: ocilib.hpp:5558
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: ocilib.h:655
ChangeTypesValues
Subscription changes flags values.
Definition: ocilib.hpp:7220
Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: ocilib.hpp:6662
void * AnyPointer
Alias for the generic void pointer.
Definition: ocilib.hpp:169
const char * what() const override
Override the std::exception::what() method.
ExceptionType GetType() const
Return the Exception type.
Connection GetConnection() const
Return the connection within the error occurred.
Object identifying the SQL data type BFILE.
Definition: ocilib.hpp:4491
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: ocilib.hpp:5177
Enum< MessageStateValues > MessageState
Message state.
Definition: ocilib.hpp:7581
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: ocilib.h:578
Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: ocilib.hpp:966
ResultValues
Direct Operation Result enumerated values.
Definition: ocilib.hpp:8777
friend T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Definition: ocilib.hpp:879
Object identifying the SQL data type INTERVAL.
Definition: ocilib.hpp:3263
Enum< FormatTypeValues > FormatType
Format type.
Definition: ocilib.hpp:524
int GetInternalErrorCode() const
Return the OCILIB error code.
Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Definition: ocilib.hpp:1789
CollectionTypeValues
Collection type enumerated values.
Definition: ocilib.hpp:5195
Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: ocilib.hpp:7924
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
Definition: ocilib.h:537
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: ocilib.hpp:1464
GroupingModeValues
Grouping mode enumerated values.
Definition: ocilib.hpp:8569
Class allowing the administration of Oracle Queue tables.
Definition: ocilib.hpp:8559
Enum< LongModeValues > LongMode
LONG data type mapping modes.
Definition: ocilib.hpp:5800
Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: ocilib.hpp:3697
Enqueue object for queuing messages into an Oracle Queue.
Definition: ocilib.hpp:7900
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: ocilib.h:462
SessionFlagsValues
Session flags enumerated values.
Definition: ocilib.hpp:798
TransactionFlagsValues
Transaction flags enumerated values.
Definition: ocilib.hpp:2544
Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: ocilib.hpp:1839
OpenModeValues
Open Modes enumerated values.
Definition: ocilib.hpp:435
Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: ocilib.hpp:5756
A connection or session Pool.
Definition: ocilib.hpp:1510
BindModeValues
Bind Modes enumerated values.
Definition: ocilib.hpp:5763
Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: ocilib.hpp:8610
Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: ocilib.hpp:701
BindDirectionValues
Bind direction enumerated values.
Definition: ocilib.hpp:5519
Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: ocilib.hpp:1861
Enum< LongTypeValues > LongType
Type of Long.
Definition: ocilib.hpp:496
struct OCI_File OCI_File
Oracle External Large objects:
Definition: ocilib.h:522
struct OCI_Thread OCI_Thread
OCILIB encapsulation of OCI Threads.
Definition: ocilib.h:709
Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: ocilib.hpp:723
ObjectEventValues
Object events enumerated values.
Definition: ocilib.hpp:7376
LongModeValues
LONG data type mapping modes enumerated values.
Definition: ocilib.hpp:5785
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Flags< StartModeValues > StartMode
Oracle instance start modes.
Definition: ocilib.hpp:855
ObjectTypeValues
Object Type enumerated values.
Definition: ocilib.hpp:4834
Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: ocilib.hpp:8770
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Definition: ocilib.h:568
Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: ocilib.hpp:337
void * CallbackPointer
Alias used for storing user callback method pointers.
Definition: ocilib.hpp:214
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: ocilib.hpp:5378
Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: ocilib.hpp:791
Template class providing OCILIB handles auto memory, life cycle and scope management.
NumericTypeValues
Numeric type enumerated values.
Definition: ocilib.hpp:308
Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: ocilib.hpp:4711
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: ocilib.hpp:196
Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: ocilib.hpp:769
CharsetFormValues
Charset form enumerated values.
Definition: ocilib.hpp:344
void(* POCI_THREADKEYDEST)(void *data)
Thread key destructor prototype.
Definition: ocilib.h:824
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: ocilib.hpp:178
CollationIDValues
Collation ID enumerated values.
Definition: ocilib.hpp:366
struct OCI_Long OCI_Long
Oracle Long data type.
Definition: ocilib.h:559
Provides type information on Oracle Database objects.
Definition: ocilib.hpp:4680
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: ocilib.hpp:7931
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: ocilib.h:665
NavigationModeValues
Navigation Mode enumerated values.
Definition: ocilib.hpp:8135
Object identifying the SQL data type NUMBER.
Definition: ocilib.hpp:2652
IntervalTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3280
POCI_THREAD ThreadProc
Thread callback.
Definition: ocilib.hpp:1339
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: ocilib.hpp:912
DequeueModeValues
Dequeue mode enumerated values.
Definition: ocilib.hpp:8087
Statement GetStatement() const
Return the statement within the error occurred.
DataTypeValues
Data type enumerated values.
Definition: ocilib.hpp:262
ImportModeValues
OCI libraries import mode enumerated values.
Definition: ocilib.hpp:754
Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: ocilib.hpp:1811
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: ocilib.hpp:4470
MessageStateValues
Message state enumerated values.
Definition: ocilib.hpp:7562
OracleVersionValues
Oracle Version enumerated values.
Definition: ocilib.hpp:232
Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: ocilib.hpp:428
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: ocilib.hpp:4169
Enum< CollationIDValues > CollationID
Type of Collation ID.
Definition: ocilib.hpp:403
SeekModeValues
Seek Modes enumerated values.
Definition: ocilib.hpp:6647
Enum< ResultValues > Result
Direct Operation Result.
Definition: ocilib.hpp:8798
QueueTypeValues
Queue Type enumerated values.
Definition: ocilib.hpp:8426
ExceptionTypeValues
Exception type enumerated values.
Definition: ocilib.hpp:547
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: ocilib.hpp:4459
Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: ocilib.hpp:5536
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: ocilib.h:618
PropertyFlagsValues
Column properties flags values.
Definition: ocilib.hpp:7008
Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: ocilib.hpp:1887
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: ocilib.h:628
FormatTypeValues
Format type enumerated values.
Definition: ocilib.hpp:503
AQ message.
Definition: ocilib.hpp:7551
Database resultset.
Definition: ocilib.hpp:6637
Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: ocilib.hpp:2568
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
Definition: ocilib.hpp:160
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: ocilib.h:608
StartModeValues
Oracle instance start modes enumerated values.
Definition: ocilib.hpp:836
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
Definition: ocilib.h:474
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: ocilib.h:689
Object identifying the SQL data type TIMESTAMP.
Definition: ocilib.hpp:3662
Enum< QueueTypeValues > QueueType
Queue Type.
Definition: ocilib.hpp:8443
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: ocilib.hpp:8067
Object identifying the SQL data type OBJECT.
Definition: ocilib.hpp:4817
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: ocilib.hpp:730
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: ocilib.h:739
Subscription to database or objects changes.
Definition: ocilib.hpp:7200
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: ocilib.h:497
Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: ocilib.hpp:5212
Object identifying the SQL data type DATE.
Definition: ocilib.hpp:2827
Enum< OpenModeValues > OpenMode
Open Modes.
Definition: ocilib.hpp:450