OCILIB (C and C++ Driver for Oracle)  4.4.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-2017 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 };
244 
253 
260 {
262  TypeNumeric = OCI_CDT_NUMERIC,
264  TypeDate = OCI_CDT_DATETIME,
266  TypeString = OCI_CDT_TEXT,
268  TypeLong = OCI_CDT_LONG,
270  TypeStatement = OCI_CDT_CURSOR,
272  TypeLob = OCI_CDT_LOB,
274  TypeFile = OCI_CDT_FILE,
276  TypeTimestamp = OCI_CDT_TIMESTAMP,
278  TypeInterval = OCI_CDT_INTERVAL,
280  TypeRaw = OCI_CDT_RAW,
282  TypeObject = OCI_CDT_OBJECT,
284  TypeCollection = OCI_CDT_COLLECTION,
286  TypeReference = OCI_CDT_REF,
288  TypeBoolean = OCI_CDT_BOOLEAN
289 };
290 
299 
306 {
308  NumericShort = OCI_NUM_SHORT,
310  NumericInt = OCI_NUM_INT,
312  NumericBigInt = OCI_NUM_BIGINT,
314  NumericUnsignedShort = OCI_NUM_USHORT,
316  NumericUnsignedInt = OCI_NUM_UINT,
318  NumericUnsignedBigInt = OCI_NUM_BIGUINT,
320  NumericDouble = OCI_NUM_DOUBLE,
322  NumericFloat = OCI_NUM_FLOAT,
324  NumericNumber = OCI_NUM_NUMBER
325 };
326 
335 
342 {
344  CharsetFormDefault = OCI_CSF_DEFAULT,
346  CharsetFormNational = OCI_CSF_NATIONAL
347 };
356 
363 {
365  SeekSet = OCI_SEEK_SET,
367  SeekEnd = OCI_SEEK_END,
369  SeekOffset = OCI_SEEK_CUR
370 };
371 
380 
387 {
389  ReadOnly = OCI_LOB_READONLY,
391  ReadWrite = OCI_LOB_READWRITE
392 };
393 
402 
409 {
411  LobBinary = OCI_BLOB,
413  LobCharacter = OCI_CLOB,
415  LobNationalCharacter = OCI_NCLOB
416 };
417 
426 
433 {
435  LongBinary = OCI_BLONG,
437  LongCharacter = OCI_CLONG
438 };
439 
448 
455 {
457  FormatDate = OCI_FMT_DATE,
459  FormatTimestamp = OCI_FMT_TIMESTAMP,
461  FormatNumeric = OCI_FMT_NUMERIC,
463  FormatBinaryDouble = OCI_FMT_BINARY_DOUBLE,
465  FormatBinaryFloat = OCI_FMT_BINARY_FLOAT
466 };
467 
476 
485 class Exception : public std::exception
486 {
487  template<class T>
488  friend T Check(T result);
489  friend class Statement;
490 
491 public:
492 
499  {
501  OracleError = OCI_ERR_ORACLE,
503  OcilibError = OCI_ERR_OCILIB,
505  OracleWarning = OCI_ERR_WARNING
506  };
507 
516 
522  ostring GetMessage() const;
523 
530  ExceptionType GetType() const;
531 
537  int GetOracleErrorCode() const;
538 
544  int GetInternalErrorCode() const;
545 
551  Statement GetStatement() const;
552 
558  Connection GetConnection() const;
559 
572  unsigned int GetRow() const;
573 
582  const char *what() const throw() override;
583 
589  virtual ~Exception() throw ();
590 
591 private:
592 
593  Exception();
594  Exception(OCI_Error *err);
595 
596  std::string _what;
597  OCI_Statement *_pStatement;
598  OCI_Connection *_pConnnection;
599  unsigned int _row;
600  ExceptionType _type;
601  int _errLib;
602  int _errOracle;
603 };
604 
611 {
612  friend class Mutex;
613  friend class Connection;
614  friend class Pool;
615  friend class Subscription;
616  friend class Dequeue;
617  template<class>
618  friend class HandleHolder;
619 
620 public:
621 
628  {
630  SourceInstance = OCI_HES_INSTANCE,
632  SourceDatabase = OCI_HES_DATABASE,
634  SourceNode = OCI_HES_NODE,
636  SourceService = OCI_HES_SERVICE,
638  SourceServiceMember = OCI_HES_SERVICE_MEMBER,
640  SourceASMInstance = OCI_HES_ASM_INSTANCE,
642  SourcePreConnect = OCI_HES_PRECONNECT
643  };
644 
653 
660  {
662  EventDown = OCI_HET_DOWN,
664  EventUp = OCI_HET_UP
665  };
666 
675 
682  {
684  Default = OCI_ENV_DEFAULT,
686  Threaded = OCI_ENV_THREADED,
688  Events = OCI_ENV_EVENTS
689  };
690 
699 
706  {
708  ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
710  ImportRuntime = OCI_IMPORT_MODE_RUNTIME
711  };
712 
721 
728  {
730  CharsetAnsi = OCI_CHAR_ANSI,
732  CharsetWide = OCI_CHAR_WIDE
733  };
734 
743 
750  {
752  SessionDefault = OCI_SESSION_DEFAULT,
754  SessionXa = OCI_SESSION_XA,
756  SessionSysDba = OCI_SESSION_SYSDBA,
758  SessionSysOper = OCI_SESSION_SYSOPER
759  };
760 
769 
776  {
778  StartOnly = OCI_DB_SPM_START,
780  StartMount = OCI_DB_SPM_MOUNT,
782  StartOpen = OCI_DB_SPM_OPEN,
784  StartFull = OCI_DB_SPM_FULL
785  };
786 
795 
802  {
804  StartDefault = OCI_DB_SPF_DEFAULT,
806  StartForce = OCI_DB_SPF_FORCE,
808  StartRestrict = OCI_DB_SPF_RESTRICT
809  };
810 
819 
826  {
828  ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
830  ShutdownClose = OCI_DB_SDM_CLOSE,
832  ShutdownDismount = OCI_DB_SDM_DISMOUNT,
834  ShutdownFull = OCI_DB_SDM_FULL
835  };
836 
845 
852  {
855  ShutdowntDefault = OCI_DB_SDF_DEFAULT,
858  ShutdowTrans = OCI_DB_SDF_TRANS,
862  ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
865  ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
871  ShutdownAbort = OCI_DB_SDF_ABORT
872  };
873 
882 
889  {
891  OracleClientBytes = OCI_MEM_ORACLE,
893  OcilibBytes = OCI_MEM_OCILIB,
895  AllBytes = OCI_MEM_ALL
896  };
897 
906 
914  typedef void(*HAHandlerProc) (Connection &con, HAEventSource eventSource, HAEventType eventType, Timestamp &time);
915 
934  static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
935 
949  static void Cleanup();
950 
959  static Environment::EnvironmentFlags GetMode();
960 
966  static Environment::ImportMode GetImportMode();
967 
973  static Environment::CharsetMode GetCharset();
974 
982  static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
983 
989  static bool Initialized();
990 
1001  static OracleVersion GetCompileVersion();
1002 
1008  static unsigned int GetCompileMajorVersion();
1009 
1015  static unsigned int GetCompileMinorVersion();
1016 
1022  static unsigned int GetCompileRevisionVersion();
1023 
1033  static OracleVersion GetRuntimeVersion();
1034 
1040  static unsigned int GetRuntimeMajorVersion();
1041 
1047  static unsigned int GetRuntimeMinorVersion();
1048 
1054  static unsigned int GetRuntimeRevisionVersion();
1055 
1066  static void EnableWarnings(bool value);
1067 
1099  static bool SetFormat(FormatType formatType, const ostring& format);
1100 
1111  static ostring GetFormat(FormatType formatType);
1112 
1139  static void StartDatabase(const ostring &db, const ostring &user, const ostring& pwd,
1140  Environment::StartFlags startFlags,
1141  Environment::StartMode startMode,
1142  Environment::SessionFlags sessionFlags = SessionSysDba,
1143  const ostring& spfile = OTEXT(""));
1144 
1170  static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1171  Environment::ShutdownFlags shutdownFlags,
1172  Environment::ShutdownMode shutdownMode,
1173  Environment::SessionFlags sessionFlags = SessionSysDba);
1174 
1185  static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1186 
1203  static void SetHAHandler(HAHandlerProc handler);
1204 
1205 private:
1206 
1207  class EnvironmentHandle : HandleHolder < AnyPointer >
1208  {
1209  friend class Environment;
1210  };
1211 
1212  static void HAHandler(OCI_Connection *pConnection, unsigned int source, unsigned int event, OCI_Timestamp *pTimestamp);
1213  static unsigned int TAFHandler(OCI_Connection *pConnection, unsigned int type, unsigned int event);
1214  static void NotifyHandler(OCI_Event *pEvent);
1215  static void NotifyHandlerAQ(OCI_Dequeue *pDequeue);
1216 
1217  template<class T>
1218  static T GetUserCallback(AnyPointer ptr);
1219 
1220  template<class T>
1221  static void SetUserCallback(AnyPointer ptr, T callback);
1222 
1223  template<class T>
1224  static void SetSmartHandle(AnyPointer ptr, T handle);
1225 
1226  template<class T>
1227  static T GetSmartHandle(AnyPointer ptr);
1228 
1229  static Handle * GetEnvironmentHandle();
1230 
1231  static Environment& GetInstance();
1232 
1233  Environment();
1234 
1235  void SelfInitialize(EnvironmentFlags mode, const ostring& libpath);
1236  void SelfCleanup();
1237 
1238  Locker _locker;
1239  EnvironmentHandle _handle;
1240  ConcurrentMap<AnyPointer, Handle *> _handles;
1241  ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1242  EnvironmentFlags _mode;
1243  bool _initialized;
1244 };
1245 
1256 class Thread
1257 {
1258 public:
1259 
1267 
1276  static ThreadHandle Create();
1277 
1285  static void Destroy(ThreadHandle handle);
1286 
1296  static void Run(ThreadHandle handle, ThreadProc func, void *args);
1297 
1308  static void Join(ThreadHandle handle);
1309 
1317  static ThreadId GetThreadId(ThreadHandle handle);
1318 };
1319 
1329 class Mutex
1330 {
1331 public:
1332 
1341  static MutexHandle Create();
1342 
1350  static void Destroy(MutexHandle handle);
1351 
1359  static void Acquire(MutexHandle handle);
1360 
1368  static void Release(MutexHandle handle);
1369 };
1370 
1382 {
1383 public:
1384 
1392 
1405  static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1406 
1415  static void SetValue(const ostring& name, AnyPointer value);
1416 
1427  static AnyPointer GetValue(const ostring& name);
1428 };
1429 
1437 class Pool : public HandleHolder<OCI_Pool *>
1438 {
1439 public:
1440 
1447  {
1449  ConnectionPool = OCI_POOL_CONNECTION,
1451  SessionPool = OCI_POOL_SESSION
1452  };
1453 
1462 
1468  Pool();
1469 
1487  Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1488  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1490 
1509  void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1510  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1512 
1518  void Close();
1519 
1548  Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1549 
1561  unsigned int GetTimeout() const;
1562 
1576  void SetTimeout(unsigned int value);
1577 
1587  bool GetNoWait() const;
1588 
1601  void SetNoWait(bool value);
1602 
1608  unsigned int GetBusyConnectionsCount() const;
1609 
1615  unsigned int GetOpenedConnectionsCount() const;
1616 
1622  unsigned int GetMinSize() const;
1623 
1629  unsigned int GetMaxSize() const;
1630 
1636  unsigned int GetIncrement() const;
1637 
1646  unsigned int GetStatementCacheSize() const;
1647 
1655  void SetStatementCacheSize(unsigned int value);
1656 };
1657 
1665 class Connection : public HandleHolder<OCI_Connection *>
1666 {
1667  friend class Environment;
1668  friend class Exception;
1669  friend class Statement;
1670  friend class File;
1671  friend class Timestamp;
1672  friend class Pool;
1673  friend class Object;
1674  friend class TypeInfo;
1675  friend class Reference;
1676  friend class Resultset;
1677  friend class Subscription;
1678 
1679  template<class, int>
1680  friend class Lob;
1681  template<class>
1682  friend class Collection;
1683 public:
1684 
1691  {
1693  FailoverRequestSession = OCI_FOT_SESSION,
1695  FailoverRequestSelect = OCI_FOT_SELECT
1696  };
1697 
1706 
1713  {
1715  FailoverEventEnd = OCI_FOE_END,
1717  FailoverEventAbort = OCI_FOE_ABORT,
1719  FailoverEventReauthentificate = OCI_FOE_REAUTH,
1721  FailoverEventBegin = OCI_FOE_BEGIN,
1723  FailoverEventError = OCI_FOE_ERROR
1724  };
1725 
1734 
1741  {
1743  FailoverOk = OCI_FOC_OK,
1745  FailoverRetry = OCI_FOC_RETRY
1746  };
1747 
1756 
1763  {
1765  TraceIdentity = OCI_TRC_IDENTITY,
1767  TraceModule = OCI_TRC_MODULE,
1769  TraceAction = OCI_TRC_ACTION,
1771  TraceDetail = OCI_TRC_DETAIL
1772  };
1773 
1782 
1790  typedef FailoverResult(*TAFHandlerProc) (Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1791 
1797  Connection();
1798 
1812  Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1813 
1856  void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1857 
1863  void Close();
1864 
1870  void Commit();
1871 
1877  void Rollback();
1878 
1887  void Break();
1888 
1896  void SetAutoCommit(bool enabled);
1897 
1903  bool GetAutoCommit() const;
1904 
1913  bool IsServerAlive() const;
1914 
1923  bool PingServer() const;
1924 
1933  ostring GetConnectionString() const;
1934 
1943  ostring GetUserName() const;
1944 
1953  ostring GetPassword() const;
1954 
1963  ostring GetServerVersion() const;
1964 
1973  OracleVersion GetVersion() const;
1974 
1980  unsigned int GetServerMajorVersion() const;
1981 
1987  unsigned int GetServerMinorVersion() const;
1988 
1994  unsigned int GetServerRevisionVersion() const;
1995 
2003  void ChangePassword(const ostring& newPwd);
2004 
2010  ostring GetSessionTag() const;
2011 
2026  void SetSessionTag(const ostring& tag);
2027 
2033  Transaction GetTransaction() const;
2034 
2048  void SetTransaction(const Transaction &transaction);
2049 
2081  bool SetFormat(FormatType formatType, const ostring& format);
2082 
2093  ostring GetFormat(FormatType formatType);
2094 
2114  void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2115 
2124  void DisableServerOutput();
2125 
2134  bool GetServerOutput(ostring &line) const;
2135 
2141  void GetServerOutput(std::vector<ostring> &lines) const;
2142 
2171  void SetTrace(SessionTrace trace, const ostring& value);
2172 
2183  ostring GetTrace(SessionTrace trace) const;
2184 
2193  ostring GetDatabase() const;
2194 
2203  ostring GetInstance() const;
2204 
2213  ostring GetService() const;
2214 
2223  ostring GetServer() const;
2224 
2233  ostring GetDomain() const;
2234 
2243  Timestamp GetInstanceStartTime() const;
2244 
2256  unsigned int GetStatementCacheSize() const;
2257 
2268  void SetStatementCacheSize(unsigned int value);
2269 
2286  unsigned int GetDefaultLobPrefetchSize() const;
2287 
2312  void SetDefaultLobPrefetchSize(unsigned int value);
2313 
2328  unsigned int GetMaxCursors() const;
2329 
2338  bool IsTAFCapable() const;
2339 
2353  void SetTAFHandler(TAFHandlerProc handler);
2354 
2360  AnyPointer GetUserData();
2361 
2369  void SetUserData(AnyPointer value);
2370 
2371 private:
2372 
2373  Connection(OCI_Connection *con, Handle *parent);
2374 };
2375 
2383 class Transaction : public HandleHolder<OCI_Transaction *>
2384 {
2385  friend class Connection;
2386 
2387 public:
2388 
2395  {
2396  Unknown = OCI_UNKNOWN,
2398  New = OCI_TRS_NEW,
2400  Tight = OCI_TRS_TIGHT,
2402  Loose = OCI_TRS_LOOSE,
2404  ReadOnly = OCI_TRS_READONLY,
2406  ReadWrite = OCI_TRS_READWRITE,
2408  Serializable = OCI_TRS_SERIALIZABLE
2409  };
2410 
2419 
2433  Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid = nullptr);
2434 
2440  void Prepare();
2441 
2447  void Start();
2448 
2454  void Stop();
2455 
2461  void Resume();
2462 
2468  void Forget();
2469 
2478  TransactionFlags GetFlags() const;
2479 
2485  unsigned int GetTimeout() const;
2486 
2487 private:
2488 
2489  Transaction(OCI_Transaction *trans);
2490 };
2491 
2502 class Number : public HandleHolder<OCI_Number *>, public Streamable
2503 {
2504  friend class Statement;
2505  friend class Resultset;
2506  friend class BindArray;
2507  friend class Object;
2508  template<class>
2509  friend class Collection;
2510 
2511 public:
2512 
2520  Number(bool create = false);
2521 
2536  Number(const otext* str, const otext* format = OTEXT(""));
2537 
2552  Number(const ostring& str, const ostring& format = OTEXT(""));
2553 
2568  void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2569 
2580  ostring ToString(const ostring& format) const;
2581 
2590  ostring ToString() const override;
2591 
2597  Number Clone() const;
2598 
2599  Number& operator ++ ();
2600  Number& operator -- ();
2601  Number operator ++ (int);
2602  Number operator -- (int);
2603 
2604  bool operator == (const Number& other) const;
2605  bool operator != (const Number& other) const;
2606  bool operator > (const Number& other) const;
2607  bool operator < (const Number& other) const;
2608  bool operator >= (const Number& other) const;
2609  bool operator <= (const Number& other) const;
2610 
2611  template<class T>
2612  Number& operator = (const T &lhs);
2613 
2614  template<class T>
2615  operator T() const;
2616 
2617  template<class T>
2618  Number operator - (const T &value);
2619 
2620  template<class T>
2621  Number operator + (const T &value);
2622 
2623  template<class T>
2624  Number operator * (const T &value);
2625 
2626  template<class T>
2627  Number operator / (const T &value);
2628 
2629  template<class T>
2630  Number& operator += (const T &value);
2631 
2632  template<class T>
2633  Number& operator -= (const T &value);
2634 
2635  template<class T>
2636  Number& operator *= (const T &value);
2637 
2638  template<class T>
2639  Number& operator /= (const T &value);
2640 
2641 private:
2642 
2643  Number(OCI_Number *pNumber, Handle *parent = nullptr);
2644 
2645  void Allocate();
2646 
2647  int Compare(const Number& other) const;
2648 
2649  template<class T>
2650  inline T GetValue() const;
2651 
2652  template<class T>
2653  Number& SetValue(const T &value);
2654 
2655  template<class T>
2656  void Add(const T &value);
2657 
2658  template<class T>
2659  void Sub(const T &value);
2660 
2661  template<class T>
2662  void Multiply(const T &value);
2663 
2664  template<class T>
2665  void Divide(const T &value);
2666 
2667  Number& operator = (OCI_Number * &lhs);
2668 };
2669 
2677 class Date : public HandleHolder<OCI_Date *>, public Streamable
2678 {
2679  friend class Statement;
2680  friend class Resultset;
2681  friend class BindArray;
2682  friend class Object;
2683  template<class>
2684  friend class Collection;
2685  friend class Message;
2686 
2687 public:
2688 
2694  static Date SysDate();
2695 
2703  Date(bool create = false);
2704 
2719  Date(const otext* str, const otext* format = OTEXT(""));
2720 
2736  Date(const ostring& str, const ostring& format = OTEXT(""));
2737 
2743  bool IsValid() const;
2744 
2750  int GetYear() const;
2751 
2757  void SetYear(int value);
2758 
2764  int GetMonth() const;
2765 
2771  void SetMonth(int value);
2772 
2778  int GetDay() const;
2779 
2785  void SetDay(int value);
2786 
2792  int GetHours() const;
2793 
2799  void SetHours(int value);
2800 
2806  int GetMinutes() const;
2807 
2813  void SetMinutes(int value);
2814 
2820  int GetSeconds() const;
2821 
2827  void SetSeconds(int value);
2828 
2836  int DaysBetween(const Date& other) const;
2837 
2847  void SetDate(int year, int month, int day);
2848 
2858  void SetTime(int hour, int min, int sec);
2859 
2872  void SetDateTime(int year, int month, int day, int hour, int min, int sec);
2873 
2883  void GetDate(int &year, int &month, int &day) const;
2884 
2894  void GetTime(int &hour, int &min, int &sec) const;
2895 
2908  void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const;
2909 
2917  void AddDays(int days);
2918 
2926  void AddMonths(int months);
2927 
2935  Date NextDay(const ostring& day) const;
2936 
2942  Date LastDay() const;
2943 
2952  void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
2953 
2968  void FromString(const ostring& str, const ostring& format = OTEXT(""));
2969 
2980  ostring ToString(const ostring& format) const;
2981 
2990  ostring ToString() const override;
2991 
2997  Date Clone() const;
2998 
3004  Date& operator ++ ();
3005 
3011  Date operator ++ (int);
3012 
3018  Date& operator -- ();
3019 
3025  Date operator -- (int);
3026 
3032  Date operator + (int value) const;
3033 
3039  Date operator - (int value) const;
3040 
3046  Date& operator += (int value);
3047 
3053  Date& operator -= (int value);
3054 
3060  bool operator == (const Date& other) const;
3061 
3067  bool operator != (const Date& other) const;
3068 
3074  bool operator > (const Date& other) const;
3075 
3081  bool operator < (const Date& other) const;
3082 
3088  bool operator >= (const Date& other) const;
3089 
3095  bool operator <= (const Date& other) const;
3096 
3097 private:
3098 
3099  int Compare(const Date& other) const;
3100 
3101  Date(OCI_Date *pDate, Handle *parent = nullptr);
3102 
3103  void Allocate();
3104 };
3105 
3113 class Interval : public HandleHolder<OCI_Interval *>, public Streamable
3114 {
3115  friend class Environment;
3116  friend class Statement;
3117  friend class Resultset;
3118  friend class BindArray;
3119  friend class Object;
3120  template<class>
3121  friend class Collection;
3122 
3123 public:
3124 
3131  {
3133  YearMonth = OCI_INTERVAL_YM,
3135  DaySecond = OCI_INTERVAL_DS
3136  };
3137 
3146 
3152  Interval();
3153 
3161  Interval(IntervalType type);
3162 
3174  Interval(IntervalType type, const ostring& data);
3175 
3181  IntervalType GetType() const;
3182 
3188  bool IsValid() const;
3189 
3198  int GetYear() const;
3199 
3208  void SetYear(int value);
3209 
3218  int GetMonth() const;
3219 
3228  void SetMonth(int value);
3229 
3238  int GetDay() const;
3239 
3248  void SetDay(int value);
3249 
3258  int GetHours() const;
3259 
3268  void SetHours(int value);
3269 
3278  int GetMinutes() const;
3279 
3288  void SetMinutes(int value);
3289 
3298  int GetSeconds() const;
3299 
3308  void SetSeconds(int value);
3309 
3315  int GetMilliSeconds() const;
3316 
3322  void SetMilliSeconds(int value);
3323 
3338  void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const;
3339 
3354  void SetDaySecond(int day, int hour, int min, int sec, int fsec);
3355 
3367  void GetYearMonth(int &year, int &month) const;
3368 
3380  void SetYearMonth(int year, int month);
3381 
3389  void UpdateTimeZone(const ostring& timeZone);
3390 
3401  void FromString(const ostring& data);
3402 
3411  ostring ToString(int leadingPrecision, int fractionPrecision) const;
3412 
3418  ostring ToString() const override;
3419 
3425  Interval Clone() const;
3426 
3432  Interval operator + (const Interval& other) const;
3433 
3439  Interval operator - (const Interval& other) const;
3440 
3446  Interval& operator += (const Interval& other);
3447 
3453  Interval& operator -= (const Interval& other);
3454 
3460  bool operator == (const Interval& other) const;
3461 
3467  bool operator != (const Interval& other) const;
3468 
3474  bool operator > (const Interval& other) const;
3475 
3481  bool operator < (const Interval& other) const;
3482 
3488  bool operator >= (const Interval& other) const;
3489 
3495  bool operator <= (const Interval& other) const;
3496 
3497 private:
3498 
3499  int Compare(const Interval& other) const;
3500 
3501  Interval(OCI_Interval *pInterval, Handle *parent = nullptr);
3502 };
3503 
3512 class Timestamp : public HandleHolder<OCI_Timestamp *>, public Streamable
3513 {
3514  friend class Environment;
3515  friend class Statement;
3516  friend class Resultset;
3517  friend class BindArray;
3518  friend class Object;
3519  friend class Connection;
3520  template<class>
3521  friend class Collection;
3522 
3523 public:
3524 
3531  {
3533  NoTimeZone = OCI_TIMESTAMP,
3535  WithTimeZone = OCI_TIMESTAMP_TZ,
3537  WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3538  };
3539 
3548 
3556  static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3557 
3563  Timestamp();
3564 
3572  Timestamp(TimestampType type);
3573 
3586  Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3587 
3593  TimestampType GetType() const;
3594 
3602  void Convert(const Timestamp& other);
3603 
3609  bool IsValid() const;
3610 
3616  int GetYear() const;
3617 
3623  void SetYear(int value);
3624 
3630  int GetMonth() const;
3631 
3637  void SetMonth(int value);
3638 
3644  int GetDay() const;
3645 
3651  void SetDay(int value);
3652 
3658  int GetHours() const;
3659 
3665  void SetHours(int value);
3666 
3672  int GetMinutes() const;
3673 
3679  void SetMinutes(int value);
3680 
3686  int GetSeconds() const;
3687 
3693  void SetSeconds(int value);
3694 
3700  int GetMilliSeconds() const;
3701 
3707  void SetMilliSeconds(int value);
3708 
3718  void GetDate(int &year, int &month, int &day) const;
3719 
3730  void GetTime(int &hour, int &min, int &sec, int &fsec) const;
3731 
3741  void SetDate(int year, int month, int day);
3742 
3753  void SetTime(int hour, int min, int sec, int fsec);
3754 
3768  void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const;
3769 
3784  void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3785 
3794  ostring GetTimeZone() const;
3795 
3805  void SetTimeZone(const ostring& timeZone);
3806 
3815  void GetTimeZoneOffset(int &hour, int &min) const;
3816 
3829  static void Substract(const Timestamp &lsh, const Timestamp &rsh, Interval &result);
3830 
3842  void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3843 
3855  ostring ToString(const ostring& format, int precision) const;
3856 
3862  ostring ToString() const override;
3863 
3869  Timestamp Clone() const;
3870 
3876  Timestamp& operator ++ ();
3877 
3883  Timestamp operator ++ (int);
3884 
3890  Timestamp& operator -- ();
3891 
3897  Timestamp operator -- (int);
3898 
3904  Timestamp operator + (int value) const;
3905 
3911  Timestamp operator - (int value) const;
3912 
3918  Interval operator - (const Timestamp& other);
3919 
3925  Timestamp& operator += (int value);
3926 
3932  Timestamp& operator -= (int value);
3933 
3939  Timestamp operator + (const Interval& other) const;
3940 
3946  Timestamp operator - (const Interval& other) const;
3947 
3953  Timestamp& operator += (const Interval& other);
3954 
3960  Timestamp& operator -= (const Interval& other);
3961 
3967  bool operator == (const Timestamp& other) const;
3968 
3974  bool operator != (const Timestamp& other) const;
3975 
3981  bool operator > (const Timestamp& other) const;
3982 
3988  bool operator < (const Timestamp& other) const;
3989 
3995  bool operator >= (const Timestamp& other) const;
3996 
4002  bool operator <= (const Timestamp& other) const;
4003 
4004 private:
4005 
4006  int Compare(const Timestamp& other) const;
4007 
4008  Timestamp(OCI_Timestamp *pTimestamp, Handle *parent = nullptr);
4009 };
4010 
4018 template<class T, int U>
4019 class Lob : public HandleHolder<OCI_Lob *>
4020 {
4021  friend class Statement;
4022  friend class Resultset;
4023  friend class BindArray;
4024  friend class Object;
4025  template<class>
4026  friend class Collection;
4027 
4028 public:
4029 
4035  Lob();
4036 
4047  Lob(const Connection &connection);
4048 
4059  T Read(unsigned int length);
4060 
4071  unsigned int Write(const T &content);
4072 
4083  unsigned int Append(const T& content);
4084 
4092  void Append(const Lob& other);
4093 
4108  bool Seek(SeekMode seekMode, big_uint offset);
4109 
4115  LobType GetType() const;
4116 
4122  big_uint GetOffset() const;
4123 
4129  big_uint GetLength() const;
4130 
4136  big_uint GetMaxSize() const;
4137 
4149  big_uint GetChunkSize() const;
4150 
4156  Connection GetConnection() const;
4157 
4165  void Truncate(big_uint length);
4166 
4182  big_uint Erase(big_uint offset, big_uint length);
4183 
4197  void Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4198 
4204  bool IsTemporary() const;
4205 
4218  void Open(OpenMode mode);
4219 
4225  void Flush();
4226 
4235  void Close();
4236 
4255  void EnableBuffering(bool value);
4256 
4262  Lob Clone() const;
4263 
4269  Lob& operator += (const Lob& other);
4270 
4276  bool operator == (const Lob& other) const;
4277 
4283  bool operator != (const Lob& other) const;
4284 
4285 private:
4286 
4287  bool Equals(const Lob &other) const;
4288 
4289  Lob(OCI_Lob *pLob, Handle *parent = nullptr);
4290 
4291 };
4292 
4303 
4314 
4325 
4334 class File : public HandleHolder<OCI_File *>
4335 {
4336  friend class Statement;
4337  friend class Resultset;
4338  friend class BindArray;
4339  friend class Object;
4340  template<class>
4341  friend class Collection;
4342 
4343 public:
4344 
4350  File();
4351 
4362  File(const Connection &connection);
4363 
4378  File(const Connection &connection, const ostring& directory, const ostring& name);
4379 
4390  Raw Read(unsigned int size);
4391 
4406  bool Seek(SeekMode seekMode, big_uint offset);
4407 
4416  bool Exists() const;
4417 
4423  big_uint GetOffset() const;
4424 
4430  big_uint GetLength() const;
4431 
4437  Connection GetConnection() const;
4438 
4451  void SetInfos(const ostring& directory, const ostring& name);
4452 
4458  ostring GetName() const;
4459 
4465  ostring GetDirectory() const;
4466 
4472  void Open();
4473 
4479  void Close();
4480 
4486  bool IsOpened() const;
4487 
4493  File Clone() const;
4494 
4500  bool operator == (const File& other) const;
4501 
4507  bool operator != (const File& other) const;
4508 
4509 private:
4510 
4511  bool Equals(const File &other) const;
4512 
4513  File(OCI_File *pFile, Handle *parent = nullptr);
4514 };
4515 
4523 class TypeInfo : public HandleHolder<OCI_TypeInfo *>
4524 {
4525  friend class Object;
4526  friend class Reference;
4527  template<class>
4528  friend class Collection;
4529  friend class Column;
4530 public:
4531 
4538  {
4540  Table = OCI_TIF_TABLE,
4542  View = OCI_TIF_VIEW,
4544  Type = OCI_TIF_TYPE
4545  };
4546 
4555 
4568  TypeInfo(const Connection &connection, const ostring& name, TypeInfoType type);
4569 
4575  TypeInfoType GetType() const;
4576 
4582  ostring GetName() const;
4583 
4589  Connection GetConnection() const;
4590 
4600  unsigned int GetColumnCount() const;
4601 
4616  Column GetColumn(unsigned int index) const;
4617 
4618 private:
4619 
4620  TypeInfo(OCI_TypeInfo *pTypeInfo);
4621 };
4622 
4630 class Object : public HandleHolder<OCI_Object *>, public Streamable
4631 {
4632  friend class Statement;
4633  friend class Resultset;
4634  friend class BindArray;
4635  friend class Reference;
4636  template<class>
4637  friend class Collection;
4638  friend class Message;
4639 
4640 public:
4641 
4648  {
4650  Persistent = OCI_OBJ_PERSISTENT,
4652  Transient = OCI_OBJ_TRANSIENT,
4654  Value = OCI_OBJ_VALUE
4655  };
4656 
4665 
4671  Object();
4672 
4680  Object(const TypeInfo &typeInfo);
4681 
4689  bool IsAttributeNull(const ostring& name) const;
4690 
4698  void SetAttributeNull(const ostring& name);
4699 
4705  TypeInfo GetTypeInfo() const;
4706 
4712  Reference GetReference() const;
4713 
4719  ObjectType GetType() const;
4720 
4733  template<class T>
4734  T Get(const ostring& name) const;
4735 
4749  template<class T>
4750  void Get(const ostring& name, T &value) const;
4751 
4765  template<class T>
4766  void Get(const ostring& name, Collection<T> &value) const;
4767 
4781  template<class T>
4782  void Set(const ostring& name, const T &value);
4783 
4789  Object Clone() const;
4790 
4796  ostring ToString() const;
4797 
4798 private:
4799 
4800  Object(OCI_Object *pObject, Handle *parent = nullptr);
4801 };
4802 
4810 class Reference : public HandleHolder<OCI_Ref *>, public Streamable
4811 {
4812  friend class Statement;
4813  friend class Resultset;
4814  friend class BindArray;
4815  friend class Object;
4816  template<class>
4817  friend class Collection;
4818 
4819 public:
4820 
4826  Reference();
4827 
4835  Reference(const TypeInfo &typeInfo);
4836 
4842  TypeInfo GetTypeInfo() const;
4843 
4852  Object GetObject() const;
4853 
4859  bool IsReferenceNull() const;
4860 
4869  void SetReferenceNull();
4870 
4876  Reference Clone() const;
4877 
4883  ostring ToString() const override;
4884 
4885 private:
4886 
4887  Reference(OCI_Ref *pRef, Handle *parent = nullptr);
4888 };
4889 
4898 template<class T>
4900 {
4901  template<class>
4902  friend class CollectionIterator;
4903 
4904 public:
4905 
4906  typedef T ValueType;
4908 
4910  CollectionElement(CollectionType *coll, unsigned int pos);
4911  operator T() const;
4912  CollectionElement& operator = (const ValueType& value);
4913  CollectionElement& operator = (const CollectionElement& other);
4914  bool IsNull() const;
4915  void SetNull();
4916 
4917 private:
4918 
4919  CollectionType* _coll;
4920  unsigned int _pos;
4921 };
4922 
4930 template<class T>
4932 {
4933 public:
4934 
4935  template<class>
4936  friend class Collection;
4937 
4938  typedef typename T::ValueType value_type;
4940 
4941  typedef std::random_access_iterator_tag iterator_category;
4942  typedef ptrdiff_t difference_type;
4943  typedef ptrdiff_t distance_type;
4944  typedef value_type* pointer;
4945  typedef value_type& reference;
4946 
4948  CollectionIterator(const CollectionIterator& other);
4949 
4950  CollectionIterator& operator = (const CollectionIterator& other);
4951  CollectionIterator& operator += (difference_type value);
4952  CollectionIterator& operator -= (difference_type value);
4953 
4954  T& operator*();
4955  T* operator->();
4956 
4957  CollectionIterator& operator++();
4958  CollectionIterator& operator--();
4959 
4960  CollectionIterator operator++(int);
4961  CollectionIterator operator--(int);
4962 
4963  CollectionIterator operator + (difference_type value);
4964  CollectionIterator operator - (difference_type value);
4965 
4966  difference_type operator - (const CollectionIterator &other);
4967 
4968  bool operator == (const CollectionIterator& other);
4969  bool operator != (const CollectionIterator& other);
4970  bool operator > (const CollectionIterator& other);
4971  bool operator < (const CollectionIterator& other);
4972  bool operator >= (const CollectionIterator& other);
4973  bool operator <= (const CollectionIterator& other);
4974 
4975 protected:
4976 
4977  CollectionIterator(CollectionType *collection, unsigned int pos);
4978 
4979  T _elem;
4980 };
4981 
4989 template<class T>
4990 class Collection : public HandleHolder<OCI_Coll *>, public Streamable
4991 {
4992  friend class Statement;
4993  friend class Resultset;
4994  friend class BindArray;
4995  friend class Object;
4996  template<class>
4997  friend class CollectionIterator;
4998  template<class>
4999  friend class Collection;
5000 
5001 public:
5002 
5009  {
5011  Varray = OCI_COLL_VARRAY,
5013  NestedTable = OCI_COLL_NESTED_TABLE,
5015  IndexedTable = OCI_COLL_INDEXED_TABLE
5016  };
5017 
5026 
5032  Collection();
5033 
5041  Collection(const TypeInfo &typeInfo);
5042 
5048  CollectionType GetType() const;
5049 
5055  unsigned int GetMax() const;
5056 
5062  unsigned int GetSize() const;
5063 
5074  unsigned int GetCount() const;
5075 
5083  void Truncate(unsigned int size);
5084 
5091  void Clear();
5092 
5103  bool IsElementNull(unsigned int index) const;
5104 
5115  void SetElementNull(unsigned int index);
5116 
5134  bool Delete(unsigned int index) const;
5135 
5143  T Get(unsigned int index) const;
5144 
5153  void Set(unsigned int index, const T &value);
5154 
5163  void Append(const T &data);
5164 
5170  TypeInfo GetTypeInfo() const;
5171 
5177  Collection Clone() const;
5178 
5184  ostring ToString() const override;
5185 
5192 
5199 
5205  iterator begin();
5206 
5212  const_iterator begin() const;
5213 
5219  iterator end();
5220 
5226  const_iterator end() const;
5227 
5233  CollectionElement<T> operator [] (unsigned int index);
5234 
5240  const CollectionElement<T> operator [] (unsigned int index) const;
5241 
5242 private:
5243 
5244  static T GetElem(OCI_Elem *elem, Handle *parent);
5245 
5246  static void SetElem(OCI_Elem *elem, const T &value);
5247 
5248  Collection(OCI_Coll *pColl, Handle *parent = nullptr);
5249 };
5250 
5258 template<class T, int U>
5259 class Long : public HandleHolder<OCI_Long *>
5260 {
5261  friend class Statement;
5262  friend class Resultset;
5263  friend class BindArray;
5264 
5265 public:
5266 
5272  Long();
5273 
5281  Long(const Statement &statement);
5282 
5293  unsigned int Write(const T& content);
5294 
5300  unsigned int GetLength() const;
5301 
5307  T GetContent() const;
5308 
5309 private:
5310 
5311  Long(OCI_Long *pLong, Handle *parent = nullptr);
5312 };
5313 
5321 class BindInfo : public HandleHolder<OCI_Bind *>
5322 {
5323  friend class Statement;
5324 
5325 public:
5326 
5333  {
5335  In = OCI_BDM_IN,
5337  Out = OCI_BDM_OUT,
5339  InOut = OCI_BDM_IN_OUT
5340  };
5341 
5350 
5356  ostring GetName() const;
5357 
5363  DataType GetType() const;
5364 
5384  unsigned int GetSubType() const;
5385 
5395  unsigned int GetDataCount() const;
5396 
5402  Statement GetStatement() const;
5403 
5424  void SetDataNull(bool value, unsigned int index = 1);
5425 
5440  bool IsDataNull(unsigned int index = 1) const;
5441 
5455  void SetCharsetForm(CharsetForm value);
5456 
5462  BindDirection GetDirection() const;
5463 
5464 private:
5465 
5466  BindInfo(OCI_Bind *pBind, Handle *parent);
5467 };
5468 
5476 class Statement : public HandleHolder<OCI_Statement *>
5477 {
5478  friend class Exception;
5479  friend class Resultset;
5480  template<class, int>
5481  friend class Long;
5482  friend class BindInfo;
5483  friend class BindObject;
5484 
5485 public:
5486 
5493  {
5495  TypeSelect = OCI_CST_SELECT,
5497  TypeUpdate = OCI_CST_UPDATE,
5499  TypeDelete = OCI_CST_DELETE,
5501  TypeInsert = OCI_CST_INSERT,
5503  TypeCreate = OCI_CST_CREATE,
5505  TypeDrop = OCI_CST_DROP,
5507  TypeAlter = OCI_CST_ALTER,
5509  TypeBegin = OCI_CST_BEGIN,
5511  TypeDeclare = OCI_CST_DECLARE,
5513  TypeCall = OCI_CST_CALL
5514  };
5515 
5524 
5531  {
5533  FetchForward = OCI_SFM_DEFAULT,
5535  FetchScrollable = OCI_SFM_SCROLLABLE
5536  };
5537 
5546 
5553  {
5555  BindByPosition = OCI_BIND_BY_POS,
5557  BindByName = OCI_BIND_BY_NAME
5558  };
5559 
5568 
5575  {
5577  LongExplicit = OCI_LONG_EXPLICIT,
5579  LongImplicit = OCI_LONG_IMPLICIT
5580  };
5581 
5590 
5596  Statement();
5597 
5608  Statement(const Connection &connection);
5609 
5615  Connection GetConnection() const;
5616 
5643  void Describe(const ostring& sql);
5644 
5668  void Parse(const ostring& sql);
5669 
5680  void Prepare(const ostring& sql);
5681 
5687  void ExecutePrepared();
5688 
5696  void Execute(const ostring& sql);
5697 
5715  template<class T>
5716  unsigned int ExecutePrepared(T callback);
5717 
5738  template<class T, class U>
5739  unsigned int ExecutePrepared(T callback, U adapter);
5740 
5759  template<class T>
5760  unsigned int Execute(const ostring& sql, T callback);
5761 
5783  template<class T, class U>
5784  unsigned int Execute(const ostring& sql, T callback, U adapter);
5785 
5800  unsigned int GetAffectedRows() const;
5801 
5807  ostring GetSql() const;
5808 
5820  Resultset GetResultset();
5821 
5843  Resultset GetNextResultset();
5844 
5869  void SetBindArraySize(unsigned int size);
5870 
5876  unsigned int GetBindArraySize() const;
5877 
5893  void AllowRebinding(bool value);
5894 
5903  bool IsRebindingAllowed() const;
5904 
5921  unsigned int GetBindIndex(const ostring& name) const;
5922 
5928  unsigned int GetBindCount() const;
5929 
5944  BindInfo GetBind(unsigned int index) const;
5945 
5956  BindInfo GetBind(const ostring& name) const;
5957 
5977  template<class T>
5978  void Bind(const ostring& name, T &value, BindInfo::BindDirection mode);
5979 
6001  template<class T, class U>
6002  void Bind(const ostring& name, T &value,U extraInfo, BindInfo::BindDirection mode);
6003 
6015  template<class T>
6016  void Bind(const ostring& name, Collection<T> &value, BindInfo::BindDirection mode);
6017 
6037  template<class T>
6038  void Bind(const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode);
6039 
6059  template<class T>
6060  void Bind(const ostring& name, std::vector<T> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode);
6061 
6074  template<class T>
6075  void Bind(const ostring& name, std::vector<Collection<T> > &values, TypeInfo &typeInfo, BindInfo::BindDirection mode);
6076 
6099  template<class T, class U>
6100  void Bind(const ostring& name, std::vector<T> &values, U extraInfo, BindInfo::BindDirection mode);
6101 
6122  template<class T>
6123  void Register(const ostring& name);
6124 
6142  template<class T, class U>
6143  void Register(const ostring& name, U& extraInfo);
6144 
6163  template<class T, class U>
6164  void Register(const ostring& name, U extraInfo);
6165 
6171  StatementType GetStatementType() const;
6172 
6182  unsigned int GetSqlErrorPos() const;
6183 
6194  void SetFetchMode(FetchMode value);
6195 
6204  FetchMode GetFetchMode() const;
6205 
6213  void SetBindMode(BindMode value);
6214 
6223  BindMode GetBindMode() const;
6224 
6232  void SetFetchSize(unsigned int value);
6233 
6242  unsigned int GetFetchSize() const;
6243 
6254  void SetPrefetchSize(unsigned int value);
6255 
6264  unsigned int GetPrefetchSize() const;
6265 
6284  void SetPrefetchMemory(unsigned int value);
6285 
6294  unsigned int GetPrefetchMemory() const;
6295 
6303  void SetLongMaxSize(unsigned int value);
6304 
6313  unsigned int GetLongMaxSize() const;
6314 
6325  void SetLongMode(LongMode value);
6326 
6332  LongMode GetLongMode() const;
6333 
6346  unsigned int GetSQLCommand() const;
6347 
6360  ostring GetSQLVerb() const;
6361 
6367  void GetBatchErrors(std::vector<Exception> &exceptions);
6368 
6369 private:
6370 
6371  static bool IsResultsetHandle(Handle *handle);
6372  static void OnFreeSmartHandle(SmartHandle *smartHandle);
6373 
6374  Statement(OCI_Statement *stmt, Handle *parent = nullptr);
6375 
6376  BindsHolder *GetBindsHolder(bool allocate) const;
6377 
6378  void ReleaseResultsets() const;
6379 
6380  void SetLastBindMode(BindInfo::BindDirection mode);
6381 
6382  void SetInData() const;
6383  void SetOutData() const;
6384  void ClearBinds() const;
6385 
6386  template<typename M, class T>
6387  void Bind1 (M &method, const ostring& name, T& value, BindInfo::BindDirection mode);
6388 
6389  template<typename M, class T>
6390  void Bind2 (M &method, const ostring& name, T &value, BindInfo::BindDirection mode);
6391 
6392  template<typename M, class T>
6393  void BindVector1(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode);
6394 
6395  template<typename M, class T, class U>
6396  void BindVector2(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, U type);
6397 
6398  template<typename T>
6399  unsigned int Fetch(T callback);
6400 
6401  template<typename T, typename U>
6402  unsigned int Fetch(T callback, U adapter);
6403 };
6404 
6412 class Resultset : public HandleHolder<OCI_Resultset *>
6413 {
6414  friend class Statement;
6415 public:
6416 
6423  {
6425  SeekAbsolute = OCI_SFD_ABSOLUTE,
6427  SeekRelative = OCI_SFD_RELATIVE
6428  };
6429 
6438 
6451  template<class T>
6452  T Get(unsigned int index) const;
6453 
6467  template<class T>
6468  void Get(unsigned int index, T &value) const;
6469 
6482  template<class T>
6483  T Get(const ostring& name) const;
6484 
6495  template<class T>
6496  void Get(const ostring &name, T &value) const;
6497 
6512  template<class T, class U>
6513  bool Get(T& value, U adapter) const;
6514 
6530  template<typename T>
6531  unsigned int ForEach(T callback);
6532 
6555  template<typename T, typename U>
6556  unsigned int ForEach(T callback, U adapter);
6557 
6571  bool Next();
6572 
6586  bool Prev();
6587 
6599  bool First();
6600 
6612  bool Last();
6613 
6634  bool Seek(SeekMode mode, int offset);
6635 
6641  unsigned int GetCount() const;
6642 
6653  unsigned int GetCurrentRow() const;
6654 
6668  unsigned int GetColumnIndex(const ostring& name) const;
6669 
6675  unsigned int GetColumnCount() const;
6676 
6687  Column GetColumn(unsigned int index) const;
6688 
6699  Column GetColumn(const ostring& name) const;
6700 
6711  bool IsColumnNull(unsigned int index) const;
6712 
6720  bool IsColumnNull(const ostring& name) const;
6721 
6727  Statement GetStatement() const;
6728 
6734  bool operator ++ (int);
6735 
6741  bool operator -- (int);
6742 
6749  bool operator += (int offset);
6750 
6757  bool operator -= (int offset);
6758 
6759 private:
6760 
6761  Resultset(OCI_Resultset *resultset, Handle *parent);
6762 };
6763 
6771 class Column : public HandleHolder<OCI_Column *>
6772 {
6773  friend class TypeInfo;
6774  friend class Resultset;
6775 
6776 public:
6777 
6784  {
6786  NoFlags = OCI_CPF_NONE,
6789  IsIdentity = OCI_CPF_IS_IDENTITY,
6793  IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6796  IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL
6797  };
6798 
6807 
6808  ostring GetName() const;
6809 
6818  ostring GetSQLType() const;
6819 
6829  ostring GetFullSQLType() const;
6830 
6836  DataType GetType() const;
6837 
6855  unsigned int GetSubType() const;
6856 
6862  CharsetForm GetCharsetForm() const;
6863 
6873  unsigned int GetSize() const;
6874 
6880  int GetScale() const;
6881 
6887  int GetPrecision() const;
6888 
6894  int GetFractionalPrecision() const;
6895 
6901  int GetLeadingPrecision() const;
6902 
6913  PropertyFlags GetPropertyFlags() const;
6914 
6920  bool IsNullable() const;
6921 
6931  bool IsCharSemanticUsed() const;
6932 
6942  TypeInfo GetTypeInfo() const;
6943 
6944 private:
6945 
6946  Column(OCI_Column *pColumn, Handle *parent);
6947 };
6948 
6959 class Subscription : public HandleHolder<OCI_Subscription *>
6960 {
6961  friend class Event;
6962 
6963 public:
6964 
6972  typedef void (*NotifyHandlerProc) (Event &evt);
6973 
6980  {
6982  ObjectChanges = OCI_CNT_OBJECTS,
6984  RowChanges = OCI_CNT_ROWS,
6986  DatabaseChanges = OCI_CNT_DATABASES,
6988  AllChanges = OCI_CNT_ALL
6989  };
6990 
6999 
7005  Subscription();
7006 
7022  void Register(const Connection &connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7023 
7038  void Unregister();
7039 
7045  void Watch(const ostring& sql);
7046 
7052  ostring GetName() const;
7053 
7059  unsigned int GetTimeout() const;
7060 
7066  unsigned int GetPort() const;
7067 
7076  Connection GetConnection() const;
7077 
7078 private:
7079 
7080  Subscription(OCI_Subscription *pSubcription);
7081 };
7082 
7093 class Event : public HandleHolder<OCI_Event *>
7094 {
7095  friend class Subscription;
7096  friend class Environment;
7097 
7098 public:
7099 
7106  {
7108  DatabaseStart = OCI_ENT_STARTUP,
7110  DatabaseShutdown = OCI_ENT_SHUTDOWN,
7112  DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7114  DatabaseDrop = OCI_ENT_DROP_DATABASE,
7116  Unregister = OCI_ENT_DEREGISTER,
7118  ObjectChanged = OCI_ENT_OBJECT_CHANGED
7119  };
7120 
7129 
7136  {
7138  ObjectInserted = OCI_ONT_INSERT,
7140  ObjectUpdated = OCI_ONT_UPDATE,
7142  ObjectDeleted = OCI_ONT_DELETE,
7144  ObjectAltered = OCI_ONT_ALTER,
7146  ObjectDropped = OCI_ONT_DROP,
7148  ObjectGeneric = OCI_ONT_GENERIC
7149  };
7150 
7159 
7165  EventType GetType() const;
7166 
7175  ObjectEvent GetObjectEvent() const;
7176 
7182  ostring GetDatabaseName() const;
7183 
7192  ostring GetObjectName() const;
7193 
7199  ostring GetRowID() const;
7200 
7206  Subscription GetSubscription() const;
7207 
7208 private:
7209 
7210  Event(OCI_Event *pEvent);
7211 };
7212 
7220 class Agent : public HandleHolder<OCI_Agent *>
7221 {
7222  friend class Message;
7223  friend class Dequeue;
7224 
7225 public:
7226 
7249  Agent(const Connection &connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7250 
7256  ostring GetName() const;
7257 
7271  void SetName(const ostring& value);
7272 
7281  ostring GetAddress() const;
7282 
7296  void SetAddress(const ostring& value);
7297 
7298 private:
7299 
7300  Agent(OCI_Agent *pAgent, Handle *parent);
7301 };
7302 
7310 class Message : public HandleHolder<OCI_Msg *>
7311 {
7312  friend class Dequeue;
7313 
7314 public:
7315 
7322  {
7324  Ready = OCI_AMS_READY,
7326  Waiting = OCI_AMS_WAITING,
7328  Processed = OCI_AMS_PROCESSED,
7330  Expired = OCI_AMS_EXPIRED
7331  };
7332 
7341 
7371  Message(const TypeInfo &typeInfo);
7372 
7381  void Reset();
7382 
7388  template<class T>
7389  T GetPayload();
7390 
7398  template<class T>
7399  void SetPayload(const T &value);
7400 
7409  Date GetEnqueueTime() const;
7410 
7416  int GetAttemptCount() const;
7417 
7423  MessageState GetState() const;
7424 
7435  Raw GetID() const;
7436 
7445  int GetExpiration() const;
7446 
7466  void SetExpiration(int value);
7467 
7476  int GetEnqueueDelay() const;
7477 
7500  void SetEnqueueDelay(int value);
7501 
7510  int GetPriority() const;
7511 
7524  void SetPriority(int value);
7525 
7535  Raw GetOriginalID() const;
7536 
7548  void SetOriginalID(const Raw &value);
7549 
7558  ostring GetCorrelation() const;
7559 
7570  void SetCorrelation(const ostring& value);
7571 
7585  ostring GetExceptionQueue() const;
7586 
7613  void SetExceptionQueue(const ostring& value);
7614 
7623  Agent GetSender() const;
7624 
7632  void SetSender(const Agent &agent);
7633 
7645  void SetConsumers(std::vector<Agent> &agents);
7646 
7647 private:
7648 
7649  Message(OCI_Msg *pMessage, Handle *parent);
7650 };
7651 
7659 class Enqueue : public HandleHolder<OCI_Enqueue *>
7660 {
7661 public:
7662 
7669  {
7671  Before = OCI_ASD_BEFORE,
7673  OnTop = OCI_ASD_TOP
7674  };
7675 
7684 
7691  {
7693  Immediate = OCI_AMV_IMMEDIATE,
7695  OnCommit = OCI_AMV_ON_COMMIT
7696  };
7697 
7706 
7728  Enqueue(const TypeInfo &typeInfo, const ostring& queueName);
7729 
7737  void Put(const Message &message);
7738 
7747  EnqueueVisibility GetVisibility() const;
7748 
7759  void SetVisibility(EnqueueVisibility value);
7760 
7769  EnqueueMode GetMode() const;
7770 
7789  void SetMode(EnqueueMode value);
7790 
7801  Raw GetRelativeMsgID() const;
7802 
7816  void SetRelativeMsgID(const Raw &value);
7817 };
7818 
7826 class Dequeue : public HandleHolder<OCI_Dequeue *>
7827 {
7828  friend class Environment;
7829 
7830 public:
7831 
7839  typedef void (*NotifyAQHandlerProc) (Dequeue &dequeue);
7840 
7847  {
7849  Browse = OCI_ADM_BROWSE,
7851  Locked = OCI_ADM_LOCKED,
7853  Remove = OCI_ADM_REMOVE,
7855  Confirm = OCI_ADM_REMOVE_NODATA
7856  };
7857 
7866 
7873  {
7875  Immediate = OCI_AMV_IMMEDIATE,
7877  OnCommit = OCI_AMV_ON_COMMIT
7878  };
7879 
7888 
7895  {
7897  FirstMessage = OCI_ADN_FIRST_MSG,
7899  NextMessage = OCI_ADN_NEXT_MSG,
7902  NextTransaction = OCI_ADN_NEXT_TRANSACTION
7903  };
7904 
7913 
7922  Dequeue(const TypeInfo &typeInfo, const ostring& queueName);
7923 
7937  Message Get();
7938 
7954  Agent Listen(int timeout);
7955 
7964  ostring GetConsumer() const;
7965 
7977  void SetConsumer(const ostring& value);
7978 
7987  ostring GetCorrelation() const;
7988 
8000  void SetCorrelation(const ostring& value);
8001 
8010  Raw GetRelativeMsgID() const;
8011 
8019  void SetRelativeMsgID(const Raw &value);
8020 
8029  DequeueVisibility GetVisibility() const;
8030 
8045  void SetVisibility(DequeueVisibility value);
8046 
8055  DequeueMode GetMode() const;
8056 
8067  void SetMode(DequeueMode value);
8068 
8077  NavigationMode GetNavigation() const;
8078 
8098  void SetNavigation(NavigationMode value);
8099 
8108  int GetWaitTime() const;
8109 
8127  void SetWaitTime(int value);
8128 
8136  void SetAgents(std::vector<Agent> &agents);
8137 
8154  void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8155 
8164  void Unsubscribe();
8165 
8166 private:
8167 
8168  Dequeue(OCI_Dequeue *pDequeue);
8169 };
8170 
8176 class Queue
8177 {
8178 public:
8179 
8186  {
8188  NormalQueue = OCI_AQT_NORMAL,
8190  ExceptionQueue = OCI_AQT_EXCEPTION,
8192  NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8193  };
8194 
8203 
8228  static void Create(const Connection &connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8229  unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8230  bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8231 
8252  static void Alter(const Connection &connection, const ostring& queue,
8253  unsigned int maxRetries= 0, unsigned int retryDelay= 0,
8254  unsigned int retentionTime= 0, const ostring& comment = OTEXT(""));
8255 
8271  static void Drop(const Connection &connection, const ostring& queue);
8272 
8290  static void Start(const Connection &connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8291 
8310  static void Stop(const Connection &connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8311 };
8312 
8319 {
8320 public:
8321 
8329  {
8331  None = OCI_AGM_NONE,
8334  Transactionnal = OCI_AGM_TRANSACTIONNAL
8335  };
8336 
8345 
8353  {
8355  Buffered = OCI_APM_BUFFERED,
8357  Persistent = OCI_APM_PERSISTENT,
8359  All = OCI_APM_ALL
8360  };
8361 
8370 
8405  static void Create(const Connection &connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8406  const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8407  GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8408  unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8409  const ostring& compatible = OTEXT(""));
8410 
8429  static void Alter(const Connection &connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8430 
8451  static void Drop(const Connection &connection, const ostring& table, bool force = true);
8452 
8476  static void Purge(const Connection &connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8477 
8495  static void Migrate(const Connection &connection, const ostring& table, const ostring& compatible = OTEXT(""));
8496 };
8497 
8505 class DirectPath : public HandleHolder<OCI_DirPath *>
8506 {
8507 public:
8508 
8515  {
8517  Default = OCI_DCM_DEFAULT,
8519  Force = OCI_DCM_FORCE
8520  };
8521 
8530 
8537  {
8539  ResultComplete = OCI_DPR_COMPLETE,
8541  ResultError = OCI_DPR_ERROR,
8543  ResultFull = OCI_DPR_FULL ,
8545  ResultPartial = OCI_DPR_PARTIAL,
8547  ResultEmpty = OCI_DPR_EMPTY
8548  };
8549 
8558 
8580  DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8581 
8598  void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8599 
8630  template<class T>
8631  void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8632 
8643  void Reset();
8644 
8650  void Prepare();
8651 
8670  DirectPath::Result Convert();
8671 
8683  DirectPath::Result Load();
8684 
8693  void Finish();
8694 
8707  void Abort();
8708 
8717  void Save();
8718 
8724  void FlushRow();
8725 
8737  void SetCurrentRows(unsigned int value);
8738 
8747  unsigned int GetCurrentRows() const;
8748 
8757  unsigned int GetMaxRows() const;
8758 
8767  unsigned int GetRowCount() const;
8768 
8781  unsigned int GetAffectedRows() const;
8782 
8796  void SetDateFormat(const ostring& format);
8797 
8824  void SetParallel(bool value);
8825 
8840  void SetNoLog(bool value);
8841 
8855  void SetCacheSize(unsigned int value);
8856 
8867  void SetBufferSize(unsigned int value);
8868 
8882  void SetConversionMode(ConversionMode value);
8883 
8912  unsigned int GetErrorColumn();
8913 
8947  unsigned int GetErrorRow();
8948 };
8949 
8950 }
8951 
8952 #include "ocilib_impl.hpp"
8953 
8954 #endif
8955 
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:727
Encapsulate a Resultset column or object member properties.
Definition: ocilib.hpp:6771
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: ocilib.hpp:4324
DequeueVisibilityValues
Message visibility enumerated values.
Definition: ocilib.hpp:7872
STL compliant Collection Random iterator class.
Definition: ocilib.hpp:4931
Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: ocilib.hpp:768
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:1381
Exception class handling all OCILIB errors.
Definition: ocilib.hpp:485
Provides SQL bind informations.
Definition: ocilib.hpp:5321
TypeInfoTypeValues
Type of object information enumerated values.
Definition: ocilib.hpp:4537
EventTypeValues
Event type enumerated values.
Definition: ocilib.hpp:7105
LobTypeValues
Lob types enumerated values.
Definition: ocilib.hpp:408
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: ocilib.hpp:5198
Enum< BindModeValues > BindMode
Bind Modes.
Definition: ocilib.hpp:5567
OCILIB ++ Namespace.
HAEventSourceValues
HA Event sources enumerated values.
Definition: ocilib.hpp:627
Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: ocilib.hpp:7865
Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: ocilib.hpp:1461
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: ocilib.hpp:355
FetchModeValues
Fetch Modes enumerated values.
Definition: ocilib.hpp:5530
HAEventTypeValues
HA Event types enumerated values.
Definition: ocilib.hpp:659
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:8176
SessionTraceValues
Session trace enumerated values.
Definition: ocilib.hpp:1762
Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: ocilib.hpp:8344
Subscription Event.
Definition: ocilib.hpp:7093
StatementTypeValues
Statement Type enumerated values.
Definition: ocilib.hpp:5492
Enum< LobTypeValues > LobType
Type of Lob.
Definition: ocilib.hpp:425
Enum< DataTypeValues > DataType
Column data type.
Definition: ocilib.hpp:298
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:5476
A connection or session with a specific database.
Definition: ocilib.hpp:1665
Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: ocilib.hpp:6806
static class allowing to manipulate threads
Definition: ocilib.hpp:1256
PoolTypeValues
Pool type enumerated values.
Definition: ocilib.hpp:1446
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Definition: ocilib.h:598
Object identifying the SQL data type LONG.
Definition: ocilib.hpp:5259
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:2383
FailoverResultValues
Failover callback results enumerated values.
Definition: ocilib.hpp:1740
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:4664
LongTypeValues
Long types enumerated values.
Definition: ocilib.hpp:432
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Definition: ocilib.h:729
TimestampTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3530
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: ocilib.hpp:801
Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: ocilib.hpp:881
AQ identified agent for messages delivery.
Definition: ocilib.hpp:7220
Static class allowing managing mutexes.
Definition: ocilib.hpp:1329
Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: ocilib.hpp:7887
Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: ocilib.hpp:252
Oracle Direct path loading encapsulation.
Definition: ocilib.hpp:8505
Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: ocilib.hpp:7705
Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: ocilib.hpp:7912
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Definition: ocilib.h:588
Enum< EventTypeValues > EventType
Event type.
Definition: ocilib.hpp:7128
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: ocilib.hpp:7668
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:6998
Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: ocilib.hpp:515
ConversionModeValues
Conversion mode enumerated values.
Definition: ocilib.hpp:8514
Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: ocilib.hpp:844
Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: ocilib.hpp:698
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: ocilib.hpp:825
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:4810
Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: ocilib.hpp:3145
SeekModeValues
Seek Modes enumerated values.
Definition: ocilib.hpp:362
Enum< StatementTypeValues > StatementType
Statement Type.
Definition: ocilib.hpp:5523
PurgeModeValues
Purge mode enumerated values.
Definition: ocilib.hpp:8352
Static class in charge of library initialization / cleanup.
Definition: ocilib.hpp:610
FailoverRequestValues
Failover request enumerated values.
Definition: ocilib.hpp:1690
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
Definition: ocilib.hpp:4899
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: ocilib.hpp:888
Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: ocilib.hpp:7158
FailoverEventValues
Failover events enumerated values.
Definition: ocilib.hpp:1712
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: ocilib.h:655
ChangeTypesValues
Subscription changes flags values.
Definition: ocilib.hpp:6979
Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: ocilib.hpp:6437
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:4334
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: ocilib.hpp:4990
Enum< MessageStateValues > MessageState
Message state.
Definition: ocilib.hpp:7340
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: ocilib.h:578
Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: ocilib.hpp:905
ResultValues
Direct Operation Result enumerated values.
Definition: ocilib.hpp:8536
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:818
Object identifying the SQL data type INTERVAL.
Definition: ocilib.hpp:3113
Enum< FormatTypeValues > FormatType
Format type.
Definition: ocilib.hpp:475
int GetInternalErrorCode() const
Return the OCILIB error code.
CollectionTypeValues
Collection type enumerated values.
Definition: ocilib.hpp:5008
Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: ocilib.hpp:7683
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
Definition: ocilib.h:537
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: ocilib.hpp:1391
GroupingModeValues
Grouping mode enumerated values.
Definition: ocilib.hpp:8328
Class allowing the administration of Oracle Queue tables.
Definition: ocilib.hpp:8318
Enum< LongModeValues > LongMode
LONG data type mapping modes.
Definition: ocilib.hpp:5589
Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: ocilib.hpp:3547
Enqueue object for queuing messages into an Oracle Queue.
Definition: ocilib.hpp:7659
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:749
TransactionFlagsValues
Transaction flags enumerated values.
Definition: ocilib.hpp:2394
Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: ocilib.hpp:1733
OpenModeValues
Open Modes enumerated values.
Definition: ocilib.hpp:386
Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: ocilib.hpp:5545
A connection or session Pool.
Definition: ocilib.hpp:1437
BindModeValues
Bind Modes enumerated values.
Definition: ocilib.hpp:5552
Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: ocilib.hpp:8369
Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: ocilib.hpp:652
BindDirectionValues
Bind direction enumerated values.
Definition: ocilib.hpp:5332
Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: ocilib.hpp:1755
Enum< LongTypeValues > LongType
Type of Long.
Definition: ocilib.hpp:447
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:674
ObjectEventValues
Object events enumerated values.
Definition: ocilib.hpp:7135
LongModeValues
LONG data type mapping modes enumerated values.
Definition: ocilib.hpp:5574
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:794
ObjectTypeValues
Object Type enumerated values.
Definition: ocilib.hpp:4647
Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: ocilib.hpp:8529
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Definition: ocilib.h:568
Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: ocilib.hpp:334
void * CallbackPointer
Alias used for storing user callback method pointers.
Definition: ocilib.hpp:214
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: ocilib.hpp:5191
Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: ocilib.hpp:742
Template class providing OCILIB handles auto memory, life cycle and scope management.
NumericTypeValues
Numeric type enumerated values.
Definition: ocilib.hpp:305
Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: ocilib.hpp:4554
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: ocilib.hpp:196
Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: ocilib.hpp:720
CharsetFormValues
Charset form enumerated values.
Definition: ocilib.hpp:341
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
struct OCI_Long OCI_Long
Oracle Long data type.
Definition: ocilib.h:559
Provides type information on Oracle Database objects.
Definition: ocilib.hpp:4523
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: ocilib.hpp:7690
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: ocilib.h:665
NavigationModeValues
Navigation Mode enumerated values.
Definition: ocilib.hpp:7894
Object identifying the SQL data type NUMBER.
Definition: ocilib.hpp:2502
IntervalTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3130
POCI_THREAD ThreadProc
Thread callback.
Definition: ocilib.hpp:1266
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: ocilib.hpp:851
DequeueModeValues
Dequeue mode enumerated values.
Definition: ocilib.hpp:7846
Statement GetStatement() const
Return the statement within the error occurred.
DataTypeValues
Data type enumerated values.
Definition: ocilib.hpp:259
ImportModeValues
OCI libraries import mode enumerated values.
Definition: ocilib.hpp:705
Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: ocilib.hpp:1705
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: ocilib.hpp:4313
MessageStateValues
Message state enumerated values.
Definition: ocilib.hpp:7321
OracleVersionValues
Oracle Version enumerated values.
Definition: ocilib.hpp:232
Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: ocilib.hpp:379
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: ocilib.hpp:4019
SeekModeValues
Seek Modes enumerated values.
Definition: ocilib.hpp:6422
Enum< ResultValues > Result
Direct Operation Result.
Definition: ocilib.hpp:8557
QueueTypeValues
Queue Type enumerated values.
Definition: ocilib.hpp:8185
ExceptionTypeValues
Exception type enumerated values.
Definition: ocilib.hpp:498
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: ocilib.hpp:4302
Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: ocilib.hpp:5349
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: ocilib.h:618
PropertyFlagsValues
Column properties flags values.
Definition: ocilib.hpp:6783
Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: ocilib.hpp:1781
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: ocilib.h:628
FormatTypeValues
Format type enumerated values.
Definition: ocilib.hpp:454
AQ message.
Definition: ocilib.hpp:7310
Database resultset.
Definition: ocilib.hpp:6412
Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: ocilib.hpp:2418
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:775
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:3512
Enum< QueueTypeValues > QueueType
Queue Type.
Definition: ocilib.hpp:8202
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: ocilib.hpp:7826
Object identifying the SQL data type OBJECT.
Definition: ocilib.hpp:4630
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: ocilib.hpp:681
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: ocilib.h:739
Subscription to database or objects changes.
Definition: ocilib.hpp:6959
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: ocilib.h:497
Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: ocilib.hpp:5025
Object identifying the SQL data type DATE.
Definition: ocilib.hpp:2677
Enum< OpenModeValues > OpenMode
Open Modes.
Definition: ocilib.hpp:401