1
/* Copyright Oracle Corporation 2000, 2001. All Rights Reserved. */
5
occiControl.h - header file for OCCI control classes
8
Class definitions for MetaData,SQLException,Environment,
9
Connection,Statement, ConnectionPool, StatelessConnectionPool
12
<note any documents related to this facility>
15
<external functions declared for use outside package - one-line
19
<other external functions declared - one-line descriptions>
24
<other useful comments, qualifications, etc.>
27
rvadraha 09/30/03 - New Binary/CharacterStreamMode for Statement class
28
rvallam 02/12/03 - modify BFloat/BDouble interface to use the new
30
shiyer 01/21/03 - add getPoolNameUString to ConnectionPool
31
shiyer 12/19/02 - Add cache sorted flush get/set to Environment
32
shiyer 12/31/02 - added OCI_ATTR_CHAR_SIZE to typeattr attrs
33
shiyer 12/09/02 - ensure new virtual interfaces are in order
34
cparampa 10/12/02 - AQ Additions
35
rvallam 10/12/02 - added new methods for array pin
36
shiyer 10/09/02 - Statement caching, Stateless Connection
37
Pooling - UTF16 support. Added NLS versions
38
of getErrorMessage in SQLException
39
rvallam 10/11/02 - added native float/double API - get(set) methods
40
for Statement and ResultSet class
41
cparampa 09/23/02 - added methods for statement caching
42
shiyer 10/01/02 - setVector versions for Windows
43
shiyer 07/31/02 - 10iR1, OCCI Globalization support
44
cparampa 09/23/02 - added methods for statement caching
45
praghuna 09/23/02 - 2333038:Fwd merge to 10i/MAIN
46
cparampa 08/26/02 - added class StatelessConnectionPool
47
added create/terminateStatelessConnnectionPool in Env
48
vvinay 08/06/02 - XA additions
49
vvinay 06/25/02 - fix #2415021: math moved to occiHeapAlloc.h
50
aahluwal 06/04/02 - bug 2360115
51
vvinay 02/21/02 - operator= added for SQLException
52
gayyappa 12/27/01 - add set/getDatabaseNCharParam
53
gayyappa 11/22/01 - modify interface to use strings for CharSet
54
gayyappa 10/01/01 - call reserve() on vector in set/getVector
56
rkasamse 07/26/01 - add env handle attrs - cache max/opt size
57
rvallam 07/23/01 - bug 1891228 - added throw() in destructor
59
rvallam 06/14/01 - replace call to get(set)VectorOfRefs in
60
get(set)Vector for Ref<T> with code in
62
rvallam 11/06/01 - renamed internal methods in get/setVector to
63
get(set)VectorOfPObjects/get(set)VectorOfOCIRefs
64
as part of NT porting fix
65
added destructors to SQLException and MetaData
66
rvallam 05/03/01 - added const to the vector parameter in setVector
67
of Statement for Ref<T>
68
rratnam 04/10/01 - removed references to wstring
69
kmohan 04/04/01 - include math.h for WIN32COMMON
70
rvallam 04/02/01 - fixed linux porting bug 1654670
71
gayyappa 03/27/01 - add code for templated getVector on stmt for objects.
72
rvallam 03/20/01 - passed dummy parameter for Type in getVector for
73
void * in statement and ResultSet
74
rratnam 03/15/01 - fixed set and getRef / get and setVector for NULL
76
rkasamse 03/19/01 - 1676579: HP compilation errors
77
rratnam 03/07/01 - derived SQLException from exception, added what()
78
chliang 03/05/01 - disable olint
79
rvallam 02/23/01 - made getReadSQL/getWriteSQL methods const
80
rratnam 01/29/01 - add closeStream() to Statement/ResultSet
81
rvallam 01/30/01 - added private method getListType() to
83
rratnam 01/03/01 - removed preTruncationLength() and isTruncated(),
84
added setBinary/CharacterStreamMode()
85
rratnam 01/03/01 - added new method setErrorOnBusy in ConnectionPool
86
rratnam 12/29/00 - added a createProxyConnection without roles
87
gayyappa 12/14/00 - add virtual functions getStatement/getConnection
88
to resultset and statement (fix bug# 1529888)
89
gayyappa 12/13/00 - remove setErrorOnTruncate from Statement/resultset.
90
rvallam 11/30/00 - removed #define NEVER
91
gayyappa 11/17/00 - split get method in Map to getReadSQL
93
rvallam 10/20/00 - modify cacheflush() to flushCache()
94
added enums to MetaData
95
rvallam 09/14/00 - uncomment result set getMetaData method
96
rename it to getColumnListMetaData.
97
add get/set interval methods to stmt.
98
add getinterval methods to resultset.
99
gayyappa 08/30/00 - added virtual destructor to occiconnection.
100
add default values to registerOutParam in
102
removed get/set vector and anydata in statement.
103
removed Stream header in ifdef directive.
104
rvallam 08/10/00 - uncomment gets(), update occiConnection, update
106
slari 08/06/00 - add statement stream methods
107
slari 08/04/00 - add Statement::getXXX methods
108
slari 08/02/00 - add Stream
109
rratnam 08/04/00 - put in connection-cloning, proxy connections
110
rvallam 08/04/00 - changed metadata header - method signatures
111
rkasamse 08/04/00 - add setObject,setRef methods on Statement
112
slari 07/27/00 - add Statement::setNull
113
slari 07/26/00 - disable getBytes
114
slari 07/25/00 - enable getBytes and getRowid
115
rratnam 07/25/00 - Conn Pooling changes - added ConnectionPool,
116
Connection, removed Session
117
modified Environment (made getOCIEnvironment(),
118
getMap() and getMode() const,
119
added create/terminateConnectionPool(),
120
added userName and password to createConnection() )
121
rkasamse 07/26/00 - uncomment getObject methods
122
slari 07/10/00 - enable getString
123
slari 07/05/00 - add result set methods
124
rkasamse 07/17/00 - add get function to Map
125
rratnam 06/16/00 - updated Session::getMetaData() to take the
127
rvallam 06/13/00 - updated MetaData
128
rratnam 06/13/00 - added getRef() to Statement
130
made getOCIError(), getOCIEnvironment()
131
and getOCIServiceContext() in
133
kmohan 05/31/00 - Datamember Session * changed to
135
in the class MetaData
136
change ORASTRINGSTL to ORASTRING
137
slari 05/26/00 - change ORAVECTOR to ORAVECTORSTL
138
slari 05/22/00 - add initial Statement class methods
139
slari 05/10/00 - enable Connection and Session methods
140
slari 04/21/00 - provide trivial implementation for
142
slari 04/17/00 - make Environment methods abstract
143
slari 04/13/00 - add Environment
144
gayyappa 04/18/00 - changed defn of SQLException
145
kmohan 04/11/00 - added class definitions
146
rkasamse 04/03/00 - header (interface) files for OCCI
148
rkasamse 04/03/00 - Creation
152
#ifndef _olint /* disable olint check */
154
#ifndef OCCICONTROL_ORACLE
155
# define OCCICONTROL_ORACLE
157
#ifndef OCCICOMMON_ORACLE
158
#include <occiCommon.h>
168
/*---------------------------------------------------------------------------
169
PUBLIC TYPES AND CONSTANTS
170
---------------------------------------------------------------------------*/
177
{ATTR_PTYPE = OCI_ATTR_PTYPE,
178
ATTR_TIMESTAMP = OCI_ATTR_TIMESTAMP,
179
ATTR_OBJ_ID = OCI_ATTR_OBJ_ID,
180
ATTR_OBJ_NAME = OCI_ATTR_OBJ_NAME,
181
ATTR_OBJ_SCHEMA = OCI_ATTR_OBJ_SCHEMA,
182
ATTR_OBJID = OCI_ATTR_OBJID,
183
ATTR_NUM_COLS = OCI_ATTR_NUM_COLS,
184
ATTR_LIST_COLUMNS = OCI_ATTR_LIST_COLUMNS,
185
ATTR_REF_TDO = OCI_ATTR_REF_TDO,
186
ATTR_IS_TEMPORARY = OCI_ATTR_IS_TEMPORARY,
187
ATTR_IS_TYPED = OCI_ATTR_IS_TYPED,
188
ATTR_DURATION = OCI_ATTR_DURATION,
189
ATTR_COLLECTION_ELEMENT = OCI_ATTR_COLLECTION_ELEMENT,
190
ATTR_RDBA = OCI_ATTR_RDBA,
191
ATTR_TABLESPACE = OCI_ATTR_TABLESPACE,
192
ATTR_CLUSTERED = OCI_ATTR_CLUSTERED,
193
ATTR_PARTITIONED = OCI_ATTR_PARTITIONED,
194
ATTR_INDEX_ONLY = OCI_ATTR_INDEX_ONLY,
195
ATTR_LIST_ARGUMENTS = OCI_ATTR_LIST_ARGUMENTS,
196
ATTR_IS_INVOKER_RIGHTS = OCI_ATTR_IS_INVOKER_RIGHTS,
197
ATTR_LIST_SUBPROGRAMS = OCI_ATTR_LIST_SUBPROGRAMS,
198
ATTR_NAME = OCI_ATTR_NAME,
199
ATTR_OVERLOAD_ID = OCI_ATTR_OVERLOAD_ID,
200
ATTR_TYPECODE = OCI_ATTR_TYPECODE,
201
ATTR_COLLECTION_TYPECODE = OCI_ATTR_COLLECTION_TYPECODE,
202
ATTR_VERSION = OCI_ATTR_VERSION,
203
ATTR_IS_INCOMPLETE_TYPE = OCI_ATTR_IS_INCOMPLETE_TYPE,
204
ATTR_IS_SYSTEM_TYPE = OCI_ATTR_IS_SYSTEM_TYPE,
205
ATTR_IS_PREDEFINED_TYPE = OCI_ATTR_IS_PREDEFINED_TYPE,
206
ATTR_IS_TRANSIENT_TYPE = OCI_ATTR_IS_TRANSIENT_TYPE,
207
ATTR_IS_SYSTEM_GENERATED_TYPE =
208
OCI_ATTR_IS_SYSTEM_GENERATED_TYPE,
209
ATTR_HAS_NESTED_TABLE = OCI_ATTR_HAS_NESTED_TABLE,
210
ATTR_HAS_LOB = OCI_ATTR_HAS_LOB,
211
ATTR_HAS_FILE = OCI_ATTR_HAS_FILE,
212
ATTR_NUM_TYPE_ATTRS = OCI_ATTR_NUM_TYPE_ATTRS,
213
ATTR_LIST_TYPE_ATTRS = OCI_ATTR_LIST_TYPE_ATTRS,
214
ATTR_NUM_TYPE_METHODS = OCI_ATTR_NUM_TYPE_METHODS,
215
ATTR_LIST_TYPE_METHODS = OCI_ATTR_LIST_TYPE_METHODS,
216
ATTR_MAP_METHOD = OCI_ATTR_MAP_METHOD,
217
ATTR_ORDER_METHOD = OCI_ATTR_ORDER_METHOD,
218
ATTR_DATA_SIZE = OCI_ATTR_DATA_SIZE,
219
ATTR_DATA_TYPE = OCI_ATTR_DATA_TYPE,
220
ATTR_PRECISION = OCI_ATTR_PRECISION,
221
ATTR_SCALE = OCI_ATTR_SCALE,
222
ATTR_TYPE_NAME = OCI_ATTR_TYPE_NAME,
223
ATTR_SCHEMA_NAME = OCI_ATTR_SCHEMA_NAME,
224
ATTR_CHARSET_ID = OCI_ATTR_CHARSET_ID,
225
ATTR_CHARSET_FORM = OCI_ATTR_CHARSET_FORM,
226
ATTR_ENCAPSULATION = OCI_ATTR_ENCAPSULATION,
227
ATTR_IS_CONSTRUCTOR = OCI_ATTR_IS_CONSTRUCTOR,
228
ATTR_IS_DESTRUCTOR = OCI_ATTR_IS_DESTRUCTOR,
229
ATTR_IS_OPERATOR = OCI_ATTR_IS_OPERATOR,
230
ATTR_IS_SELFISH = OCI_ATTR_IS_SELFISH,
231
ATTR_IS_MAP = OCI_ATTR_IS_MAP,
232
ATTR_IS_ORDER = OCI_ATTR_IS_ORDER,
233
ATTR_IS_RNDS = OCI_ATTR_IS_RNDS,
234
ATTR_IS_RNPS = OCI_ATTR_IS_RNPS,
235
ATTR_IS_WNDS = OCI_ATTR_IS_WNDS,
236
ATTR_IS_WNPS = OCI_ATTR_IS_WNPS,
237
ATTR_NUM_ELEMS = OCI_ATTR_NUM_ELEMS,
238
ATTR_LINK = OCI_ATTR_LINK,
239
ATTR_MIN = OCI_ATTR_MIN,
240
ATTR_MAX = OCI_ATTR_MAX,
241
ATTR_INCR = OCI_ATTR_INCR,
242
ATTR_CACHE = OCI_ATTR_CACHE,
243
ATTR_ORDER = OCI_ATTR_ORDER,
244
ATTR_HW_MARK = OCI_ATTR_HW_MARK,
245
ATTR_IS_NULL = OCI_ATTR_IS_NULL,
246
ATTR_POSITION = OCI_ATTR_POSITION,
247
ATTR_HAS_DEFAULT = OCI_ATTR_HAS_DEFAULT,
248
ATTR_LEVEL = OCI_ATTR_LEVEL,
249
ATTR_IOMODE = OCI_ATTR_IOMODE,
250
ATTR_RADIX = OCI_ATTR_RADIX,
251
ATTR_SUB_NAME = OCI_ATTR_SUB_NAME,
252
ATTR_LIST_OBJECTS = OCI_ATTR_LIST_OBJECTS,
253
ATTR_NCHARSET_ID = OCI_ATTR_NCHARSET_ID,
254
ATTR_LIST_SCHEMAS = OCI_ATTR_LIST_SCHEMAS,
255
ATTR_MAX_PROC_LEN = OCI_ATTR_MAX_PROC_LEN,
256
ATTR_MAX_COLUMN_LEN = OCI_ATTR_MAX_COLUMN_LEN,
257
ATTR_CURSOR_COMMIT_BEHAVIOR =
258
OCI_ATTR_CURSOR_COMMIT_BEHAVIOR,
259
ATTR_MAX_CATALOG_NAMELEN = OCI_ATTR_MAX_CATALOG_NAMELEN,
260
ATTR_CATALOG_LOCATION = OCI_ATTR_CATALOG_LOCATION,
261
ATTR_SAVEPOINT_SUPPORT = OCI_ATTR_SAVEPOINT_SUPPORT,
262
ATTR_NOWAIT_SUPPORT = OCI_ATTR_NOWAIT_SUPPORT,
263
ATTR_AUTOCOMMIT_DDL = OCI_ATTR_AUTOCOMMIT_DDL,
264
ATTR_LOCKING_MODE = OCI_ATTR_LOCKING_MODE,
265
ATTR_IS_FINAL_TYPE = OCI_ATTR_IS_FINAL_TYPE,
266
ATTR_IS_INSTANTIABLE_TYPE = OCI_ATTR_IS_INSTANTIABLE_TYPE,
267
ATTR_IS_SUBTYPE = OCI_ATTR_IS_SUBTYPE,
268
ATTR_SUPERTYPE_SCHEMA_NAME = OCI_ATTR_SUPERTYPE_SCHEMA_NAME,
269
ATTR_SUPERTYPE_NAME = OCI_ATTR_SUPERTYPE_NAME,
270
ATTR_FSPRECISION = OCI_ATTR_FSPRECISION,
271
ATTR_LFPRECISION = OCI_ATTR_LFPRECISION,
272
ATTR_IS_FINAL_METHOD = OCI_ATTR_IS_FINAL_METHOD,
273
ATTR_IS_INSTANTIABLE_METHOD = OCI_ATTR_IS_INSTANTIABLE_METHOD,
274
ATTR_IS_OVERRIDING_METHOD = OCI_ATTR_IS_OVERRIDING_METHOD,
275
ATTR_CHAR_USED = OCI_ATTR_CHAR_USED,
276
ATTR_CHAR_SIZE = OCI_ATTR_CHAR_SIZE
281
PTYPE_TABLE = OCI_PTYPE_TABLE
282
,PTYPE_VIEW = OCI_PTYPE_VIEW
283
,PTYPE_PROC = OCI_PTYPE_PROC
284
,PTYPE_FUNC = OCI_PTYPE_FUNC
285
,PTYPE_PKG = OCI_PTYPE_PKG
286
,PTYPE_TYPE = OCI_PTYPE_TYPE
287
,PTYPE_TYPE_ATTR = OCI_PTYPE_TYPE_ATTR
288
,PTYPE_TYPE_COLL = OCI_PTYPE_TYPE_COLL
289
,PTYPE_TYPE_METHOD = OCI_PTYPE_TYPE_METHOD
290
,PTYPE_SYN = OCI_PTYPE_SYN
291
,PTYPE_SEQ = OCI_PTYPE_SEQ
292
,PTYPE_COL = OCI_PTYPE_COL
293
,PTYPE_ARG = OCI_PTYPE_ARG
294
,PTYPE_TYPE_ARG = OCI_PTYPE_TYPE_ARG
295
,PTYPE_TYPE_RESULT = OCI_PTYPE_TYPE_RESULT
296
,PTYPE_SCHEMA = OCI_PTYPE_SCHEMA
297
,PTYPE_DATABASE = OCI_PTYPE_DATABASE
298
,PTYPE_UNK = OCI_PTYPE_UNK
302
enum { DURATION_SESSION = OCI_DURATION_SESSION
303
,DURATION_TRANS = OCI_DURATION_TRANS
304
,DURATION_NULL = OCI_DURATION_NULL
305
,TYPEENCAP_PRIVATE = OCI_TYPEENCAP_PRIVATE
306
,TYPEENCAP_PUBLIC = OCI_TYPEENCAP_PUBLIC
307
,TYPEPARAM_IN = OCI_TYPEPARAM_IN
308
,TYPEPARAM_OUT = OCI_TYPEPARAM_OUT
309
,TYPEPARAM_INOUT = OCI_TYPEPARAM_INOUT
310
,CURSOR_OPEN = OCI_CURSOR_OPEN
311
,CURSOR_CLOSED = OCI_CURSOR_CLOSED
312
,CL_START = OCI_CL_START
314
,SP_SUPPORTED = OCI_SP_SUPPORTED
315
,SP_UNSUPPORTED = OCI_SP_UNSUPPORTED
316
,NW_SUPPORTED = OCI_NW_SUPPORTED
317
,NW_UNSUPPORTED = OCI_NW_UNSUPPORTED
319
,NO_AC_DDL = OCI_NO_AC_DDL
320
,LOCK_IMMEDIATE = OCI_LOCK_IMMEDIATE
321
,LOCK_DELAYED = OCI_LOCK_DELAYED
324
MetaData(const MetaData &omd);
325
unsigned int getAttributeCount() const
327
AttrId getAttributeId(unsigned int attributenum) const
329
Type getAttributeType(unsigned int attributenum) const
331
int getInt(MetaData::AttrId attrid) const
333
bool getBoolean(MetaData::AttrId attrid) const
335
unsigned int getUInt(MetaData::AttrId attrid) const
337
OCCI_STD_NAMESPACE::string getString(MetaData::AttrId attrid) const
339
UString getUString(MetaData::AttrId attrid) const
341
Number getNumber(MetaData::AttrId attrid) const
343
RefAny getRef(MetaData::AttrId attrid) const
345
Timestamp getTimestamp(MetaData::AttrId attrid) const
347
MetaData getMetaData(MetaData::AttrId attrid) const
349
OCCI_STD_NAMESPACE::vector<MetaData> getVector(MetaData::AttrId attrid)
351
void operator =(const MetaData &omd);
357
enum ociAttrType { OCI_UB1,
363
OCI_UB1PTR_TIMESTAMP,
367
OCI_DVOIDPTR_PARAMLIST,
372
OCI_OCITYPEPARAMMODE,
376
enum AttrCount {COMMON_ATTR_COUNT = 5,
377
TABLE_ATTR_COUNT = 12,
379
FUNCPROC_ATTR_COUNT = 4,
382
TYPEATTR_ATTR_COUNT = 14,
383
TYPEMTHD_ATTR_COUNT = 16,
384
COLL_ATTR_COUNT = 12,
388
ARG_TYPARG_TYPRES_ATTR_COUNT = 20,
389
SCHEMA_ATTR_COUNT = 1,
390
DATABASE_ATTR_COUNT = 13,
394
static const AttrId commonAttrId[COMMON_ATTR_COUNT];
395
static const ociAttrType commonAttrType[COMMON_ATTR_COUNT];
396
static const AttrId tableAttrId[TABLE_ATTR_COUNT];
397
static const ociAttrType tableAttrType[TABLE_ATTR_COUNT];
398
static const AttrId viewAttrId[VIEW_ATTR_COUNT];
399
static const ociAttrType viewAttrType[VIEW_ATTR_COUNT];
400
static const AttrId funcprocAttrId[FUNCPROC_ATTR_COUNT];
401
static const ociAttrType funcprocAttrType[FUNCPROC_ATTR_COUNT];
402
static const AttrId pkgAttrId[PKG_ATTR_COUNT];
403
static const ociAttrType pkgAttrType[PKG_ATTR_COUNT];
404
static const AttrId typAttrId[TYP_ATTR_COUNT];
405
static const ociAttrType typAttrType[TYP_ATTR_COUNT];
406
static const AttrId typeattrAttrId[TYPEATTR_ATTR_COUNT];
407
static const ociAttrType typeattrAttrType[TYPEATTR_ATTR_COUNT];
408
static const AttrId typmethdAttrId[TYPEMTHD_ATTR_COUNT];
409
static const ociAttrType typemthdAttrType[TYPEMTHD_ATTR_COUNT];
410
static const AttrId collAttrId[COLL_ATTR_COUNT];
411
static const ociAttrType collAttrType[COLL_ATTR_COUNT];
412
static const AttrId synAttrId[SYN_ATTR_COUNT];
413
static const ociAttrType synAttrType[SYN_ATTR_COUNT];
414
static const AttrId seqAttrId[SEQ_ATTR_COUNT];
415
static const ociAttrType seqAttrType[SEQ_ATTR_COUNT];
416
static const AttrId colAttrId[COL_ATTR_COUNT];
417
static const ociAttrType colAttrType[COL_ATTR_COUNT];
418
static const AttrId argtargtresAttrId[ARG_TYPARG_TYPRES_ATTR_COUNT];
419
static const ociAttrType argtargtresAttrType[
420
ARG_TYPARG_TYPRES_ATTR_COUNT];
421
static const AttrId schemaAttrId[SCHEMA_ATTR_COUNT];
422
static const ociAttrType schemaAttrType[SCHEMA_ATTR_COUNT];
423
static const AttrId databaseAttrId[DATABASE_ATTR_COUNT];
424
static const ociAttrType databaseAttrType[DATABASE_ATTR_COUNT];
426
Ptr<MetaDataImpl> metaDataImplPtr;
427
const OCIParam* paramhp;
428
const ConnectionImpl* sesn;
429
const AttrId* attrIdArray;
430
const ociAttrType* attrTypeArray;
433
MetaData(const Connection *sessp, const OCCI_STD_NAMESPACE::string& objName,
435
MetaData(const Connection *sessp, const UString& objName,
437
MetaData(const Connection *sessp,
439
MetaData(const Connection *sessp, MetaDataImpl *implPtr,
441
MetaData(const Connection *sessp, MetaDataImpl *implPtr,
442
OCIParam *parm, ub1 parmTyp) ;
443
ub1 getParamType(OCIParam* prm) const ;
444
const AttrId* getAttrIdArrayAddr(ub1 prmTyp) const;
445
const ociAttrType* getAttrTypeArrayAddr(ub1 prmTyp) const;
446
AttrCount getAttrCount(ub1 prmTyp) const;
447
Type getType(ociAttrType typ) const;
448
bool isListTypeAttribute(AttrId attrid,ub1 ptyp) const;
449
boolean isInvalidAttrId(AttrId attrid,sb4* pos,
450
boolean* isTypeSpecificAttrPtr) const;
451
ociAttrType getValidAttrType(sb4 index, boolean isTypeSpecificAttr)
454
int getListType (const OCIParam *plist) const;
455
unsigned int getLowerBound(int ltype) const;
456
unsigned int getUpperBound(unsigned int ltype,
457
unsigned int paramnum) const;
458
friend class ConnectionImpl;
459
friend class ResultSetImpl;
467
// specifies the type of proxy to be created,
468
// used for future enhancements
473
virtual ~Connection() { }
474
virtual Statement* createStatement(
475
const OCCI_STD_NAMESPACE::string &sql = "")
477
virtual void terminateStatement(Statement *statement) =0;
478
virtual void commit() =0;
479
virtual void rollback() =0;
480
virtual MetaData getMetaData(const OCCI_STD_NAMESPACE::string &object,
481
MetaData::ParamType prmtyp
482
= MetaData::PTYPE_UNK) const
484
virtual MetaData getMetaData(const RefAny &ref) const
486
virtual OCCI_STD_NAMESPACE::string getClientCharSet() const
488
virtual OCCI_STD_NAMESPACE::string getClientNCHARCharSet() const
490
virtual void changePassword(const OCCI_STD_NAMESPACE::string &user,
491
const OCCI_STD_NAMESPACE::string &oldPassword,
492
const OCCI_STD_NAMESPACE::string &newPassword)
494
virtual void flushCache() =0;
496
virtual OCIServer* getOCIServer() const =0;
497
virtual OCISvcCtx* getOCIServiceContext() const =0;
498
virtual OCISession* getOCISession() const =0;
502
virtual Statement* createStatement(const UString &sql) = 0;
503
virtual MetaData getMetaData(const UString &object,
504
MetaData::ParamType prmtyp
505
= MetaData::PTYPE_UNK) const
507
virtual UString getClientCharSetUString() const
509
virtual UString getClientNCHARCharSetUString() const
511
virtual void changePassword(const UString &user,
512
const UString &oldPassword,
513
const UString &newPassword)
515
virtual OCCI_STD_NAMESPACE::string getTag() const =0;
516
virtual void setStmtCacheSize(unsigned int cacheSize) = 0;
517
virtual unsigned int getStmtCacheSize() const =0;
518
virtual Statement* createStatement(const OCCI_STD_NAMESPACE::string &sql,
519
const OCCI_STD_NAMESPACE::string &tag) = 0;
520
virtual void terminateStatement(Statement* stmt,
521
const OCCI_STD_NAMESPACE::string &tag) = 0;
522
virtual bool isCached(const OCCI_STD_NAMESPACE::string &sql,
523
const OCCI_STD_NAMESPACE::string &tag = "") = 0;
524
virtual void registerSubscriptions(
525
const OCCI_STD_NAMESPACE::vector<aq::Subscription>& sub) =0;
526
virtual void unregisterSubscription(const aq::Subscription& sub) =0;
527
virtual void postToSubscriptions(
528
const OCCI_STD_NAMESPACE::vector<aq::Subscription>& sub) =0;
529
virtual Statement* createStatement(const UString &sql,
530
const UString &tag) = 0;
531
virtual void terminateStatement(Statement* stmt,
532
const UString &tag) = 0;
533
virtual bool isCached(const UString &sql,
534
const UString &tag) = 0;
537
class StatelessConnectionPool
543
HETEROGENEOUS = OCI_DEFAULT,
544
HOMOGENEOUS = OCI_SPC_HOMOGENEOUS
549
WAIT = OCI_SPOOL_ATTRVAL_WAIT,
550
NOWAIT = OCI_SPOOL_ATTRVAL_NOWAIT,
551
FORCEGET = OCI_SPOOL_ATTRVAL_FORCEGET
556
DEFAULT = OCI_DEFAULT,
557
SPD_FORCE = OCI_SPD_FORCE
560
virtual ~StatelessConnectionPool() {}
561
virtual unsigned int getBusyConnections() const =0;
562
virtual unsigned int getOpenConnections() const =0;
563
virtual unsigned int getMinConnections() const =0;
564
virtual unsigned int getMaxConnections() const =0;
565
virtual unsigned int getIncrConnections() const =0;
566
virtual OCCI_STD_NAMESPACE::string getPoolName() const =0;
567
virtual unsigned int getTimeOut() const =0;
568
virtual void setBusyOption(BusyOption busyOption) =0;
569
virtual BusyOption getBusyOption() const =0;
570
virtual void setTimeOut(unsigned int connTimeOut =0) =0;
571
virtual void setPoolSize(unsigned int maxConn =1,
572
unsigned int minConn =0, unsigned int incrConn =1) =0;
573
virtual Connection* getConnection(
574
const OCCI_STD_NAMESPACE::string &tag ="") =0;
575
virtual Connection* getConnection(
576
const OCCI_STD_NAMESPACE::string &userName,
577
const OCCI_STD_NAMESPACE::string &password,
578
const OCCI_STD_NAMESPACE::string &tag = "") =0;
579
virtual Connection* getAnyTaggedConnection(
580
const OCCI_STD_NAMESPACE::string &tag = "") =0;
581
virtual Connection* getAnyTaggedConnection(
582
const OCCI_STD_NAMESPACE::string &userName,
583
const OCCI_STD_NAMESPACE::string &Password,
584
const OCCI_STD_NAMESPACE::string &tag = "") =0;
585
virtual Connection* getProxyConnection(
586
const OCCI_STD_NAMESPACE::string &name,
587
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
588
const OCCI_STD_NAMESPACE::string &tag = "",
589
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT) =0;
590
virtual Connection* getProxyConnection(
591
const OCCI_STD_NAMESPACE::string &name,
592
const OCCI_STD_NAMESPACE::string &tag = "" ,
593
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT) =0;
594
virtual Connection* getAnyTaggedProxyConnection(
595
const OCCI_STD_NAMESPACE::string &name,
596
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
597
const OCCI_STD_NAMESPACE::string &tag = "",
598
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT) =0;
599
virtual Connection* getAnyTaggedProxyConnection(
600
const OCCI_STD_NAMESPACE::string &name,
601
const OCCI_STD_NAMESPACE::string &tag="",
602
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT ) =0;
603
virtual void releaseConnection (Connection *connection,
604
const OCCI_STD_NAMESPACE::string &tag = "") =0;
605
virtual void terminateConnection (Connection *connection) =0;
606
virtual void setStmtCacheSize(unsigned int cacheSize) =0;
607
virtual unsigned int getStmtCacheSize() const =0;
609
virtual Connection* getConnection(const UString &tag)=0;
610
virtual Connection* getConnection(const UString &userName,
611
const UString &password,
612
const UString &tag)=0;
613
virtual Connection* getAnyTaggedConnection(const UString &tag)=0;
614
virtual Connection* getAnyTaggedConnection( const UString &userName,
615
const UString &Password, const UString &tag)=0 ;
616
virtual Connection* getProxyConnection(const UString &name,
617
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
619
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT)=0;
620
virtual Connection* getProxyConnection(const UString &name,
621
const UString &tag, Connection::ProxyType
622
proxyType = Connection::PROXY_DEFAULT)=0;
623
virtual Connection* getAnyTaggedProxyConnection(const UString &name,
624
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
626
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT)=0;
627
virtual Connection* getAnyTaggedProxyConnection(const UString &name,
629
Connection::ProxyType proxyType = Connection::PROXY_DEFAULT )=0;
630
virtual void releaseConnection(Connection *connection,
631
const UString &tag)=0;
640
virtual ~ConnectionPool() {}
641
virtual unsigned int getBusyConnections() const
643
virtual unsigned int getOpenConnections() const
645
virtual unsigned int getMinConnections() const
647
virtual unsigned int getMaxConnections() const
649
virtual unsigned int getIncrConnections() const
651
virtual OCCI_STD_NAMESPACE::string getPoolName() const
653
virtual unsigned int getTimeOut() const
655
virtual void setErrorOnBusy()
657
virtual void setTimeOut(unsigned int connTimeOut =0)
659
virtual void setPoolSize(unsigned int minConn =0,
660
unsigned int maxConn =1, unsigned int incrConn =1)
662
virtual Connection* createConnection(
663
const OCCI_STD_NAMESPACE::string &userName,
664
const OCCI_STD_NAMESPACE::string &password) =0;
666
virtual Connection* createProxyConnection(
667
const OCCI_STD_NAMESPACE::string &name,
668
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
669
Connection::ProxyType proxyType =
670
Connection::PROXY_DEFAULT) =0;
672
virtual Connection* createProxyConnection(
673
const OCCI_STD_NAMESPACE::string &name,
674
Connection::ProxyType proxyType =
675
Connection::PROXY_DEFAULT) =0;
677
virtual void terminateConnection
678
(Connection *connection) =0;
682
virtual Connection* createConnection(
683
const UString &userName,
684
const UString &password) =0;
686
virtual Connection* createProxyConnection(const UString &name,
687
OCCI_STD_NAMESPACE::string roles[], unsigned int numRoles,
688
Connection::ProxyType proxyType =
689
Connection::PROXY_DEFAULT) =0;
691
virtual Connection* createProxyConnection(const UString &name,
692
Connection::ProxyType proxyType =
693
Connection::PROXY_DEFAULT) =0;
695
virtual void setStmtCacheSize(unsigned int cacheSize) =0;
696
virtual unsigned int getStmtCacheSize() const =0;
698
virtual UString getPoolNameUString() const
709
DEFAULT = OCI_DEFAULT,
712
NO_USERCALLBACKS = OCI_NO_UCB,
713
THREADED_MUTEXED = OCI_THREADED,
714
THREADED_UNMUTEXED = OCI_THREADED | OCI_ENV_NO_MUTEX,
716
USE_LDAP = OCI_USE_LDAP
719
virtual ~Environment(){}
723
static Environment * createEnvironment(
726
void *(*malocfp)(void *ctxp, size_t size) = 0,
727
void *(*ralocfp)(void *ctxp, void *memptr,
729
void (*mfreefp)(void *ctxp, void *memptr) = 0);
731
static Environment * createEnvironment(
732
const OCCI_STD_NAMESPACE::string &charset,
733
const OCCI_STD_NAMESPACE::string &ncharset,
736
void *(*malocfp)(void *ctxp, size_t size) = 0,
737
void *(*ralocfp)(void *ctxp, void *memptr,
739
void (*mfreefp)(void *ctxp, void *memptr) = 0);
741
static void terminateEnvironment(Environment *env);
743
static Environment* getXAEnvironment(const
744
OCCI_STD_NAMESPACE::string& dbname);
746
static void releaseXAEnvironment(Environment *env);
748
virtual Connection * createConnection(
749
const OCCI_STD_NAMESPACE::string &userName,
750
const OCCI_STD_NAMESPACE::string &password,
751
const OCCI_STD_NAMESPACE::string &connectString = "") = 0;
753
virtual void terminateConnection(Connection *connection) = 0;
755
virtual ConnectionPool* createConnectionPool(
756
const OCCI_STD_NAMESPACE::string &poolUserName,
757
const OCCI_STD_NAMESPACE::string &poolPassword,
758
const OCCI_STD_NAMESPACE::string &connectString ="",
759
unsigned int minConn =0,
760
unsigned int maxConn =1, unsigned int incrConn =1) = 0;
762
virtual void terminateConnectionPool(ConnectionPool *poolp) = 0;
764
virtual unsigned int getCurrentHeapSize() const = 0;
766
virtual OCIEnv * getOCIEnvironment() const = 0;
768
virtual Map *getMap() const = 0;
770
virtual void setCacheMaxSize(unsigned int maxSize) = 0;
772
virtual unsigned int getCacheMaxSize() const = 0;
774
virtual void setCacheOptSize(unsigned int OptSize) = 0;
776
virtual unsigned int getCacheOptSize() const = 0;
781
virtual Connection * createConnection(const UString &userName,
782
const UString &password, const UString &connectString) = 0;
784
virtual ConnectionPool* createConnectionPool(
785
const UString &poolUserName,
786
const UString &poolPassword, const UString &connectString,
787
unsigned int minConn =0,
788
unsigned int maxConn =1, unsigned int incrConn =1) = 0;
790
virtual Connection* getXAConnection(const
791
OCCI_STD_NAMESPACE::string& dbname) = 0;
793
virtual void releaseXAConnection(Connection* conn) =0;
795
virtual StatelessConnectionPool* createStatelessConnectionPool(
796
const OCCI_STD_NAMESPACE::string &poolUserName,
797
const OCCI_STD_NAMESPACE::string &poolPassword,
798
const OCCI_STD_NAMESPACE::string &connectString = "",
799
unsigned int maxConn = 1, unsigned int minConn = 0,
800
unsigned int incrConn = 1,
801
StatelessConnectionPool::PoolType pType
802
= StatelessConnectionPool::HETEROGENEOUS) = 0;
804
virtual StatelessConnectionPool* createStatelessConnectionPool(
805
const UString &poolUserName,
806
const UString &poolPassword,
807
const UString &connectString,
808
unsigned int maxConn = 1, unsigned int minConn = 0,
809
unsigned int incrConn = 1,
810
StatelessConnectionPool::PoolType pType
811
= StatelessConnectionPool::HETEROGENEOUS) = 0;
813
virtual void terminateStatelessConnectionPool(StatelessConnectionPool *poolp,
814
StatelessConnectionPool::DestroyMode mode = StatelessConnectionPool::DEFAULT)
816
virtual void setLDAPAuthentication(unsigned int mode) =0;
818
virtual unsigned int getLDAPAuthentication() const =0;
820
virtual void setLDAPLoginNameAndPassword(
821
const OCCI_STD_NAMESPACE::string &login,
822
const OCCI_STD_NAMESPACE::string &passwd) =0;
824
virtual void setLDAPAdminContext(const OCCI_STD_NAMESPACE::string &ctx)=0;
826
virtual OCCI_STD_NAMESPACE::string getLDAPAdminContext() const =0;
828
virtual void setLDAPHostAndPort(const OCCI_STD_NAMESPACE::string &host,
829
unsigned int port) =0;
831
virtual OCCI_STD_NAMESPACE::string getLDAPHost() const =0;
833
virtual unsigned int getLDAPPort() const =0;
835
virtual void registerSubscriptions(
836
const OCCI_STD_NAMESPACE::vector<aq::Subscription>& sub) =0;
838
virtual void unregisterSubscription(const aq::Subscription& sub) =0;
840
virtual void enableSubscription(const aq::Subscription& sub) =0;
842
virtual void disableSubscription(const aq::Subscription& sub) =0;
844
virtual bool getCacheSortedFlush() const = 0;
846
virtual void setCacheSortedFlush(bool flag) = 0;
859
virtual void put(const OCCI_STD_NAMESPACE::string&, void *(*)(void *),
860
void (*)(void *, void *)) = 0;
861
virtual void getReadSQL(
862
void *, unsigned int, void *, unsigned int, void **) const = 0;
863
virtual void getWriteSQL(
864
void *, unsigned int, void *, unsigned int, void **) const = 0;
865
virtual void put(const OCCI_STD_NAMESPACE::string&,
866
const OCCI_STD_NAMESPACE::string&, void *(*)(void *),
867
void (*)(void *, void *)) = 0;
868
virtual void putUTF16(const OCCI_STD_NAMESPACE::string&,
869
const OCCI_STD_NAMESPACE::string&, void *(*)(void *),
870
void (*)(void *, void *)) = 0;
877
class SQLException : public OCCI_STD_NAMESPACE::exception
881
virtual int getErrorCode() const;
883
virtual OCCI_STD_NAMESPACE::string getMessage() const;
885
const char *what() const throw();
887
virtual void setErrorCtx(void *ctx);
891
SQLException(const SQLException &e);
893
void operator=(const SQLException &other);
895
virtual ~SQLException() throw();
897
virtual int getXAErrorCode(const OCCI_STD_NAMESPACE::string& dbname) const;
899
virtual UString getUStringMessage() const;
901
virtual OCCI_STD_NAMESPACE::string getNLSMessage(Environment *env) const;
903
virtual UString getNLSUStringMessage(Environment *env) const;
907
Ptr<SQLExceptionImpl> ptr_;
908
SQLException(SQLExceptionImpl *ptr);
909
friend SQLException SQLExceptionCreate(int errorCode);
910
friend SQLException SQLExceptionCreate(dvoid *handle,
921
virtual ~Statement() {}
927
RESULT_SET_AVAILABLE,
928
UPDATE_COUNT_AVAILABLE,
930
STREAM_DATA_AVAILABLE
935
virtual void setSQL(const OCCI_STD_NAMESPACE::string &sql) = 0;
937
virtual OCCI_STD_NAMESPACE::string getSQL() const = 0;
939
virtual Status execute(const OCCI_STD_NAMESPACE::string &sql = "") = 0;
941
virtual ResultSet * getResultSet() = 0;
943
virtual unsigned int getUpdateCount() const = 0;
945
virtual ResultSet * executeQuery(
946
const OCCI_STD_NAMESPACE::string &sql = "") = 0;
948
virtual unsigned int executeUpdate(
949
const OCCI_STD_NAMESPACE::string &sql = "") = 0;
951
virtual Status status() const = 0;
953
virtual void closeResultSet(ResultSet *resultSet) = 0;
955
virtual void setPrefetchRowCount(unsigned int rowCount) = 0;
957
virtual void setPrefetchMemorySize(unsigned int bytes) = 0;
959
virtual void setAutoCommit(bool autoCommit) = 0;
961
virtual bool getAutoCommit() const = 0;
963
virtual OCIStmt * getOCIStatement() const = 0;
966
// methods for prepared statements with IN
969
virtual void setMaxParamSize(unsigned int paramIndex,unsigned int maxSize)=0;
971
virtual unsigned int getMaxParamSize(unsigned int paramIndex) const = 0;
973
virtual void setNull(unsigned int paramIndex, Type type) = 0;
975
virtual void setInt(unsigned int paramIndex, int x) = 0;
977
virtual void setUInt(unsigned int paramIndex, unsigned int x) = 0;
979
virtual void setFloat(unsigned int paramIndex, float x) = 0;
981
virtual void setDouble(unsigned int paramIndex, double x) = 0;
983
virtual void setNumber(unsigned int paramIndex, const Number &x) = 0;
985
virtual void setString(unsigned int paramIndex,
986
const OCCI_STD_NAMESPACE::string &x) = 0;
988
virtual void setBytes(unsigned int paramIndex, const Bytes &x) = 0;
990
virtual void setDate(unsigned int paramIndex, const Date &x) = 0;
992
virtual void setTimestamp(unsigned int paramIndex, const Timestamp &x) = 0;
994
virtual void setBlob(unsigned int paramIndex, const Blob &x) = 0;
996
virtual void setClob(unsigned int paramIndex, const Clob &x) = 0;
998
virtual void setBfile(unsigned int paramIndex, const Bfile &x) = 0;
1000
virtual void setIntervalYM(unsigned int paramIndex, const IntervalYM &x) = 0;
1002
virtual void setIntervalDS(unsigned int paramIndex, const IntervalDS &x) = 0;
1004
virtual void setRowid(unsigned int paramIndex, const Bytes &x) = 0;
1006
virtual void setRef(unsigned int paramIndex, const RefAny &x) = 0;
1008
virtual void setObject(unsigned int paramIndex, PObject * x) = 0;
1010
virtual void setDataBuffer(unsigned int paramIndex, void *buffer,
1012
sb4 size, ub2 *length, sb2 *ind = NULL,
1013
ub2 *rc = NULL) = 0;
1015
virtual void setDataBufferArray(unsigned int paramIndex, void *buffer,
1017
ub4 arraySize, ub4 *arrayLength,
1019
ub2 *elementLength, sb2 *ind = NULL,
1020
ub2 *rc = NULL) = 0;
1022
virtual void setCharSet(unsigned int paramIndex,
1023
const OCCI_STD_NAMESPACE::string & charSet) = 0;
1025
virtual OCCI_STD_NAMESPACE::string getCharSet(unsigned int paramIndex)
1028
virtual void setDatabaseNCHARParam(
1029
unsigned int paramIndex, bool isNCHAR) = 0;
1031
virtual bool getDatabaseNCHARParam(unsigned int paramIndex) const = 0;
1033
virtual void closeStream(Stream *stream) =0;
1035
virtual Stream * getStream(unsigned int paramIndex) = 0;
1037
virtual unsigned int getCurrentStreamParam() const = 0;
1039
virtual unsigned int getCurrentStreamIteration() const = 0;
1041
virtual void setBinaryStreamMode(unsigned int colIndex,
1042
unsigned int size) =0;
1044
virtual void setCharacterStreamMode(unsigned int colIndex,
1045
unsigned int size) =0;
1047
virtual void setMaxIterations(unsigned int maxIterations) = 0;
1049
virtual unsigned int getMaxIterations() const = 0;
1051
virtual void addIteration() = 0;
1053
virtual unsigned int getCurrentIteration() const = 0;
1055
virtual Status executeArrayUpdate(unsigned int arrayLength) = 0;
1058
// methods for Callable Statements
1060
virtual void registerOutParam(unsigned int paramIndex, Type type,
1061
unsigned int maxSize=0, const OCCI_STD_NAMESPACE::string &sqltype="") = 0;
1063
virtual bool isNull(unsigned int paramIndex) const = 0;
1065
virtual bool isTruncated(unsigned int paramIndex) const
1069
virtual void setErrorOnNull(unsigned int paramIndex,
1070
bool causeException) = 0;
1072
virtual void setErrorOnTruncate(unsigned int paramIndex,
1073
bool causeException) = 0;
1075
virtual int preTruncationLength(unsigned int paramIndex) const
1079
virtual int getInt(unsigned int paramIndex) = 0;
1081
virtual unsigned int getUInt(unsigned int paramIndex) = 0;
1083
virtual float getFloat(unsigned int paramIndex) = 0;
1085
virtual double getDouble(unsigned int paramIndex) = 0;
1087
virtual Number getNumber(unsigned int paramIndex) = 0;
1089
virtual OCCI_STD_NAMESPACE::string getString(unsigned int paramIndex) = 0;
1091
virtual Bytes getBytes(unsigned int paramIndex) = 0;
1093
virtual Date getDate(unsigned int paramIndex) = 0;
1095
virtual Timestamp getTimestamp(unsigned int paramIndex) = 0;
1097
virtual Bytes getRowid(unsigned int paramIndex) = 0;
1099
virtual PObject * getObject(unsigned int paramIndex) = 0;
1101
virtual Blob getBlob(unsigned int paramIndex) = 0;
1103
virtual Clob getClob(unsigned int paramIndex) = 0;
1105
virtual Bfile getBfile(unsigned int paramIndex) = 0;
1107
virtual IntervalYM getIntervalYM(unsigned int paramIndex) = 0;
1109
virtual IntervalDS getIntervalDS(unsigned int paramIndex) = 0;
1111
virtual RefAny getRef(unsigned int paramIndex) = 0;
1113
virtual ResultSet * getCursor(unsigned int paramIndex) = 0;
1115
virtual Connection* getConnection() const =0;
1119
virtual void setRef(unsigned int paramIndex, const RefAny &x,
1120
const OCCI_STD_NAMESPACE::string &typName,
1121
const OCCI_STD_NAMESPACE::string &schName = "") = 0;
1123
virtual void setSQLUString(const UString &sql) = 0;
1125
virtual UString getSQLUString() const = 0;
1127
virtual Status execute(const UString &sql) = 0;
1129
virtual ResultSet * executeQuery(
1130
const UString &sql) = 0;
1132
virtual unsigned int executeUpdate(
1133
const UString &sql) = 0;
1135
virtual void setBFloat(unsigned int paramIndex, const BFloat &fval) = 0;
1137
virtual void setBDouble(unsigned int paramIndex, const BDouble &dval) = 0;
1139
virtual void setUString(unsigned int paramIndex,
1140
const UString &x) = 0;
1142
virtual void setCharSetUString(unsigned int paramIndex,
1143
const UString & charSet) = 0;
1145
virtual UString getCharSetUString(unsigned int paramIndex)
1148
virtual void registerOutParam(unsigned int paramIndex, Type type,
1149
unsigned int maxSize, const OCCI_STD_NAMESPACE::string &typName,
1150
const OCCI_STD_NAMESPACE::string &schName) = 0;
1152
virtual void registerOutParam(unsigned int paramIndex, Type type,
1153
unsigned int maxSize, const UString &typName,
1154
const UString &schName) = 0;
1156
virtual BFloat getBFloat(unsigned int paramIndex) = 0;
1158
virtual BDouble getBDouble(unsigned int paramIndex) = 0;
1160
virtual UString getUString(unsigned int paramIndex) = 0;
1162
virtual void disableCaching() =0;
1164
virtual void setRef(unsigned int paramIndex, const RefAny &x,
1165
const UString &typName,
1166
const UString &schName) = 0;
1168
virtual void setBinaryStreamMode(unsigned int colIndex,
1169
unsigned int size, bool INArg) =0;
1171
virtual void setCharacterStreamMode(unsigned int colIndex,
1172
unsigned int size, bool INArg) =0;
1187
STREAM_DATA_AVAILABLE
1189
virtual ~ResultSet(){}
1193
virtual Status next(unsigned int numRows = 1) = 0;
1195
virtual Status status() const = 0;
1197
virtual unsigned int getNumArrayRows() const = 0;
1199
virtual void cancel() = 0;
1201
virtual void setMaxColumnSize(unsigned int colIndex, unsigned int max) = 0;
1203
virtual unsigned int getMaxColumnSize(unsigned int colIndex) const = 0;
1205
virtual bool isNull(unsigned int colIndex) const = 0;
1207
virtual bool isTruncated(unsigned int paramIndex) const
1210
virtual void setErrorOnNull(unsigned int colIndex, bool causeException) = 0;
1211
virtual void setErrorOnTruncate(unsigned int paramIndex,
1212
bool causeException) =0;
1214
virtual int preTruncationLength(unsigned int paramIndex) const
1217
virtual int getInt(unsigned int colIndex) = 0;
1219
virtual unsigned int getUInt(unsigned int colIndex) = 0;
1221
virtual float getFloat(unsigned int colIndex) = 0;
1223
virtual double getDouble(unsigned int colIndex) = 0;
1225
virtual Number getNumber(unsigned int colIndex) = 0;
1227
virtual OCCI_STD_NAMESPACE::string getString(unsigned int colIndex) = 0;
1229
virtual Bytes getBytes(unsigned int colIndex) = 0;
1231
virtual Date getDate(unsigned int colIndex) = 0;
1233
virtual Timestamp getTimestamp(unsigned int colIndex) = 0;
1235
virtual Bytes getRowid(unsigned int colIndex) = 0;
1237
virtual PObject * getObject(unsigned int colIndex) = 0;
1239
virtual Blob getBlob(unsigned int colIndex) = 0;
1241
virtual Clob getClob(unsigned int colIndex) =0;
1243
virtual Bfile getBfile(unsigned int colIndex) = 0;
1245
virtual IntervalYM getIntervalYM(unsigned int colIndex) =0;
1247
virtual IntervalDS getIntervalDS(unsigned int colIndex) =0;
1249
virtual RefAny getRef(unsigned int colIndex) = 0;
1251
virtual Bytes getRowPosition() const = 0;
1253
virtual ResultSet * getCursor(unsigned int colIndex) = 0;
1255
virtual void setDataBuffer(unsigned int colIndex, void *buffer, Type type,
1256
sb4 size = 0, ub2 *length = NULL,
1257
sb2 *ind = NULL, ub2 *rc = NULL) = 0;
1259
virtual void setCharSet(unsigned int colIndex,
1260
const OCCI_STD_NAMESPACE::string & charSet) = 0;
1262
virtual OCCI_STD_NAMESPACE::string getCharSet(unsigned int colIndex)
1265
virtual void setBinaryStreamMode(unsigned int colIndex, unsigned int size)
1268
virtual void setCharacterStreamMode(unsigned int colIndex, unsigned int size)
1271
virtual void setDatabaseNCHARParam(unsigned int paramIndex,
1274
virtual bool getDatabaseNCHARParam(unsigned int paramIndex) const = 0;
1276
virtual Stream * getStream(unsigned int colIndex) = 0;
1278
virtual void closeStream(Stream *stream) =0;
1280
virtual unsigned int getCurrentStreamColumn() const= 0;
1282
virtual unsigned int getCurrentStreamRow() const= 0;
1284
virtual OCCI_STD_NAMESPACE::vector<MetaData> getColumnListMetaData() const
1287
virtual Statement* getStatement() const=0;
1291
virtual BFloat getBFloat(unsigned int colIndex) = 0;
1293
virtual BDouble getBDouble(unsigned int colIndex) = 0;
1295
virtual UString getUString(unsigned int colIndex) = 0;
1297
virtual void setCharSetUString(unsigned int colIndex,
1298
const UString & charSet) = 0;
1300
virtual UString getCharSetUString(unsigned int colIndex)
1310
enum Status {READY_FOR_READ, READY_FOR_WRITE, INACTIVE};
1313
virtual int readBuffer(char *buffer, unsigned int size)
1315
virtual int readLastBuffer(char *buffer, unsigned int size)
1317
virtual void writeBuffer(char *buffer, unsigned int size)
1319
virtual void writeLastBuffer(char *buffer, unsigned int size)
1321
virtual Status status() const =0;
1325
/*---------------------------------------------------------------------------
1326
PROTOTYPES USED BY FUNCTION TEMPLATES
1327
-------------------------------------------------------------------------*/
1328
void getVectorOfPObjects( ResultSet *rs, unsigned int index,
1329
OCCI_STD_NAMESPACE::vector<PObject *> &vect) ;
1330
void getVectorOfOCIRefs(ResultSet *rs, unsigned int index,
1331
OCCI_STD_NAMESPACE::vector<void *> &vect) ;
1332
void getVectorOfPObjects( Statement *rs, unsigned int index,
1333
OCCI_STD_NAMESPACE::vector<PObject *> &vect) ;
1334
void getVectorOfOCIRefs(Statement *rs, unsigned int index,
1335
OCCI_STD_NAMESPACE::vector<void *> &vect) ;
1336
void setVectorOfPObjects( Statement *stmt, unsigned int paramIndex,
1337
const OCCI_STD_NAMESPACE::vector<PObject *> &vect,
1338
const OCCI_STD_NAMESPACE::string &sqltype) ;
1339
void setVectorOfPObjects( Statement *stmt, unsigned int paramIndex,
1340
const OCCI_STD_NAMESPACE::vector<PObject *> &vect,
1341
const OCCI_STD_NAMESPACE::string &schemaName,
1342
const OCCI_STD_NAMESPACE::string &typeName) ;
1343
void setVectorOfPObjects( Statement *stmt, unsigned int paramIndex,
1344
const OCCI_STD_NAMESPACE::vector<PObject *> &vect,
1345
const UString &schemaName,
1346
const UString &typeName) ;
1347
void setVectorOfOCIRefs(Statement *stmt, unsigned int paramIndex,
1348
const OCCI_STD_NAMESPACE::vector<void *> &vect,
1349
const OCCI_STD_NAMESPACE::vector<OCIInd> &vecind,
1350
const OCCI_STD_NAMESPACE::string &sqltype) ;
1351
void setVectorOfOCIRefs(Statement *stmt, unsigned int paramIndex,
1352
const OCCI_STD_NAMESPACE::vector<void *> &vect,
1353
const OCCI_STD_NAMESPACE::vector<OCIInd> &vecind,
1354
const OCCI_STD_NAMESPACE::string &schemaName,
1355
const OCCI_STD_NAMESPACE::string &typeName) ;
1356
void setVectorOfOCIRefs(Statement *stmt, unsigned int paramIndex,
1357
const OCCI_STD_NAMESPACE::vector<void *> &vect,
1358
const OCCI_STD_NAMESPACE::vector<OCIInd> &vecind,
1359
const UString &schemaName,
1360
const UString &typeName) ;
1361
void pinVectorOfOCIRefs(const Connection *conn,
1362
OCCI_STD_NAMESPACE::vector<void *> & vecRef,
1363
OCCI_STD_NAMESPACE::vector<void *> & vecCor,
1364
OCCI_STD_NAMESPACE::vector<PObject *> &vecPObj,LockOptions &lockOpt );
1367
/*---------------------------------------------------------------------------
1369
---------------------------------------------------------------------------*/
1371
/*------------------------ getVector for objects ---------------------------*/
1374
getVector - overloaded function. Retrieves the attribute in the current
1375
position as a vector of objects
1379
vect- reference to vector of objects(OUT parameter).
1382
Retrieves the column in the specified position as a vector of RefAny.
1383
The attribute at the current position should be a collection type (varray or
1384
nested table). The SQL type of the elements in the collection should be
1385
compatible with objects.
1391
compatible SQL types : NTY
1393
will call getVector(..., vector<PObject*>)
1396
// and other platforms that do not support
1397
// partial function template specialization
1400
void getVector( ResultSet *rs, unsigned int index,OCCI_STD_NAMESPACE::vector<T>
1403
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1404
getVectorOfPObjects(rs, index, vec_pobj);
1407
unsigned int size = vec_pobj.size();
1408
vect.reserve( size );
1409
for ( unsigned int i=0; i< size; i++)
1410
vect.push_back((T)vec_pobj[i]);
1415
void getVector( ResultSet *rs, unsigned int index, OCCI_STD_NAMESPACE::vector<T
1418
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1419
getVectorOfPObjects(rs, index, vec_pobj);
1422
unsigned int size = vec_pobj.size();
1423
vect.reserve( size );
1424
for (unsigned int i=0; i< size; i++)
1425
vect.push_back((T *)vec_pobj[i]);
1429
/*------------------------ getVector for objects ---------------------------*/
1432
getVector - overloaded function. Retrieves the attribute in the current
1433
position as a vector of objects
1437
vect- reference to vector of objects(OUT parameter).
1440
Retrieves the column in the specified position as a vector of RefAny.
1441
The attribute at the current position should be a collection type (varray or
1442
nested table). The SQL type of the elements in the collection should be
1443
compatible with objects.
1449
compatible SQL types : NTY
1451
will call getVector(..., vector<PObject*>)
1454
// and other platforms that do not support
1455
// partial function template specialization
1458
void getVector( Statement *stmt, unsigned int index,
1459
OCCI_STD_NAMESPACE::vector<T> &vect)
1461
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1462
getVectorOfPObjects(stmt, index, vec_pobj);
1464
unsigned int size = vec_pobj.size();
1465
vect.reserve( size );
1466
for (unsigned int i=0; i< size; i++)
1467
vect.push_back((T)vec_pobj[i]);
1471
void getVector( Statement *stmt, unsigned int index,
1472
OCCI_STD_NAMESPACE::vector<T *> &vect)
1474
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1475
getVectorOfPObjects(stmt, index, vec_pobj);
1477
unsigned int size = vec_pobj.size();
1478
vect.reserve( size );
1479
for (unsigned int i=0; i< size; i++)
1480
vect.push_back((T *)vec_pobj[i]);
1484
/*------------------------ getVector for Ref<T> ---------------------------*/
1487
getVector - overloaded function. Retrieves the attribute in the current
1488
position as a vector of Ref<T>
1492
vect- reference to vector of Ref<T>(OUT parameter).
1495
Retrieves the column in the specified position as a vector of Ref<T>.
1496
The attribute at the current position should be a collection type (varray or
1497
nested table). The SQL type of the elements in the collection should be
1498
compatible with Ref<T>.
1504
compatible SQL types : REF
1508
void getVector( ResultSet *rs, unsigned int index,
1509
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect)
1511
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1512
getVectorOfOCIRefs(rs, index, vec_ref);
1514
const Connection *sess = rs->getStatement()->getConnection();
1517
unsigned int size = vec_ref.size();
1518
vect.reserve( size );
1519
for (unsigned int i=0; i< size; i++)
1521
if (vec_ref[i] == (OCIRef *)0)
1522
vect.push_back(Ref<T>()); // pushing a default-constructed Ref
1524
vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
1529
/*------------------------ setVector for PObject*---------------------------*/
1532
SetVector - overloaded function. Binds the attribute in the current
1533
position with a vector of objects.
1537
vect- reference to vector of objects(OUT parameter).
1540
Binds the column in the specified position with a vector of signed int .
1541
The column at the current position should be a collection type (varray or
1542
nested table). The SQL type of the elements in the collection should be
1543
compatible with objects .
1549
compatible SQL types : SQLT_NTY
1551
This will be calling setVector(..., vector<PObject*>,..)
1555
// and other platforms that do not support
1556
// partial function template specialization
1559
void setVector( Statement *stmt, unsigned int index,
1560
const OCCI_STD_NAMESPACE::vector<T> &vect,
1561
const OCCI_STD_NAMESPACE::string &sqltype)
1563
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1564
unsigned int size = vect.size();
1565
vec_pobj.reserve( size );
1567
for (unsigned int i = 0; i < size; i++)
1568
vec_pobj.push_back((PObject *)vect[i]);
1570
setVectorOfPObjects(stmt, index, vec_pobj, sqltype);
1574
void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
1575
vector<T> &vect, const OCCI_STD_NAMESPACE::string &schemaName,
1576
const OCCI_STD_NAMESPACE::string &typeName)
1578
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1579
unsigned int size = vect.size();
1580
vec_pobj.reserve( size );
1582
for (unsigned int i = 0; i < size; i++)
1583
vec_pobj.push_back((PObject *)vect[i]);
1585
setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
1589
void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
1590
vector<T> &vect, const UString &schemaName,
1591
const UString &typeName)
1593
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1594
unsigned int size = vect.size();
1595
vec_pobj.reserve( size );
1597
for (unsigned int i = 0; i < size; i++)
1598
vec_pobj.push_back((PObject *)vect[i]);
1600
setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
1604
void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
1605
vector<T *> &vect, const OCCI_STD_NAMESPACE::string &sqltype)
1607
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1608
unsigned int size = vect.size();
1609
vec_pobj.reserve( size );
1611
for (unsigned int i = 0; i < size; i++)
1612
vec_pobj.push_back((PObject *)vect[i]);
1614
setVectorOfPObjects(stmt, index, vec_pobj, sqltype);
1618
void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
1619
vector<T *> &vect, const OCCI_STD_NAMESPACE::string &schemaName,
1620
const OCCI_STD_NAMESPACE::string &typeName)
1622
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1623
unsigned int size = vect.size();
1624
vec_pobj.reserve( size );
1626
for (unsigned int i = 0; i < size; i++)
1627
vec_pobj.push_back((PObject *)vect[i]);
1629
setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
1633
void setVector( Statement *stmt, unsigned int index, const OCCI_STD_NAMESPACE::
1634
vector<T *> &vect, const UString &schemaName,
1635
const UString &typeName)
1637
OCCI_STD_NAMESPACE::vector<PObject *> vec_pobj;
1638
unsigned int size = vect.size();
1639
vec_pobj.reserve( size );
1641
for (unsigned int i = 0; i < size; i++)
1642
vec_pobj.push_back((PObject *)vect[i]);
1644
setVectorOfPObjects(stmt, index, vec_pobj, schemaName, typeName);
1648
/*------------------------ setVector for Ref<T>---------------------------*/
1651
setVector - overloaded function. Binds the attribute in the current
1652
position with a vector of Ref<T>.
1656
vect- reference to vector of REF
1659
Binds the column in the specified position with a vector of signed int .
1660
The column at the current position should be a collection type (varray or
1661
nested table). The SQL type of the elements in the collection should be
1662
compatible with OCIRef* .
1668
compatible SQL types : REF
1670
This will just call setVector(..., vector<OCIRef*>,..)
1676
void setVector( Statement *stmt, unsigned int index,
1677
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1678
const OCCI_STD_NAMESPACE::string &sqltype)
1680
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1681
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
1682
unsigned int size = vect.size();
1683
vec_ref.reserve( size );
1684
vec_ind.reserve( size );
1686
for (unsigned int i = 0; i < size; i++)
1688
vec_ref.push_back((void *)vect[i].getRef());
1689
vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
1692
setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, sqltype);
1696
void setVector( Statement *stmt, unsigned int index,
1697
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1698
const OCCI_STD_NAMESPACE::string &schemaName,
1699
const OCCI_STD_NAMESPACE::string &typeName)
1701
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1702
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
1703
unsigned int size = vect.size();
1704
vec_ref.reserve( size );
1705
vec_ind.reserve( size );
1707
for (unsigned int i = 0; i < size; i++)
1709
vec_ref.push_back((void *)vect[i].getRef());
1710
vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
1713
setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
1717
void setVector( Statement *stmt, unsigned int index,
1718
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1719
const UString &schemaName,
1720
const UString &typeName)
1722
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1723
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
1724
unsigned int size = vect.size();
1725
vec_ref.reserve( size );
1726
vec_ind.reserve( size );
1728
for (unsigned int i = 0; i < size; i++)
1730
vec_ref.push_back((void *)vect[i].getRef());
1731
vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
1734
setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
1738
/*------------------------ getVector for Ref<T> ---------------------------*/
1741
getVector - overloaded function. Retrieves the attribute in the current
1742
position as a vector of Ref<T>
1746
vect- reference to vector of Ref<T>(OUT parameter).
1749
Retrieves the column in the specified position as a vector of Ref<T>.
1750
The attribute at the current position should be a collection type (varray or
1751
nested table). The SQL type of the elements in the collection should be
1752
compatible with Ref<T>.
1758
compatible SQL types : REF
1762
void getVector( Statement *stmt, unsigned int index,
1763
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect)
1765
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1766
getVectorOfOCIRefs(stmt, index, vec_ref);
1768
const Connection *sess = stmt->getConnection();
1771
unsigned int size = vec_ref.size();
1772
vect.reserve( size );
1773
for (unsigned int i=0; i< size; i++)
1775
if (vec_ref[i] == (OCIRef *)0)
1776
vect.push_back(Ref <T>()); // pushing a default-constructed Ref
1778
vect.push_back(Ref<T> (sess, (OCIRef *)vec_ref[i], FALSE));
1784
// Platform independent get/setVectorOfRefs method added
1785
// get(set)Vector of Ref<T> and get(set)VectorOfRefs are identical
1786
// in functionality.
1788
/*------------------------ getVectorOfRefs for Ref<T> ----------------------*/
1791
getVectorOfRefs - overloaded function. Retrieves the attribute in the
1792
current position as a vector of Ref<T>
1796
vect- reference to vector of Ref<T>(OUT parameter).
1799
Retrieves the column in the specified position as a vector of Ref<T>.
1800
The attribute at the current position should be a collection type (varray or
1801
nested table). The SQL type of the elements in the collection should be
1802
compatible with Ref<T>.
1808
compatible SQL types : REF
1812
void getVectorOfRefs( ResultSet *rs, unsigned int index,
1813
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect)
1815
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1816
getVectorOfOCIRefs(rs, index, vec_ref);
1818
const Connection *sess = rs->getStatement()->getConnection();
1821
unsigned int size = vec_ref.size();
1822
vect.reserve( size );
1823
for (unsigned int i=0; i< size; i++)
1825
if (vec_ref[i] == (OCIRef *)0)
1826
vect.push_back(Ref<T>()); // pushing a default-constructed Ref
1828
vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
1832
/*------------------------ setVectorOfRefs for Ref<T>-----------------------*/
1835
setVectorOfRefs - overloaded function. Binds the attribute in the current
1836
position with a vector of Ref<T>.
1840
vect- reference to vector of REF
1843
Binds the column in the specified position with a vector of signed int .
1844
The column at the current position should be a collection type (varray or
1845
nested table). The SQL type of the elements in the collection should be
1846
compatible with OCIRef* .
1852
compatible SQL types : REF
1854
This will just call setVector(..., vector<OCIRef*>,..)
1860
void setVectorOfRefs( Statement *stmt, unsigned int index,
1861
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1862
const OCCI_STD_NAMESPACE::string &sqltype)
1864
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1865
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
1866
unsigned int size = vect.size();
1867
vec_ref.reserve( size );
1868
vec_ind.reserve( size );
1870
for (unsigned int i = 0; i < size; i++)
1872
vec_ref.push_back((void *)vect[i].getRef());
1873
vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
1876
setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, sqltype);
1880
void setVectorOfRefs( Statement *stmt, unsigned int index,
1881
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1882
const OCCI_STD_NAMESPACE::string &schemaName,
1883
const OCCI_STD_NAMESPACE::string &typeName)
1885
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1886
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
1887
unsigned int size = vect.size();
1888
vec_ref.reserve( size );
1889
vec_ind.reserve( size );
1891
for (unsigned int i = 0; i < size; i++)
1893
vec_ref.push_back((void *)vect[i].getRef());
1894
vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
1897
setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
1901
void setVectorOfRefs( Statement *stmt, unsigned int index,
1902
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1903
const UString &schemaName,
1904
const UString &typeName)
1906
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1907
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
1908
unsigned int size = vect.size();
1909
vec_ref.reserve( size );
1910
vec_ind.reserve( size );
1912
for (unsigned int i = 0; i < size; i++)
1914
vec_ref.push_back((void *)vect[i].getRef());
1915
vec_ind.push_back( vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
1918
setVectorOfOCIRefs(stmt, index, vec_ref, vec_ind, schemaName, typeName);
1921
/*------------------------ getVectorOfRefs for Ref<T> ----------------------*/
1924
getVectorOfRefs - overloaded function. Retrieves the attribute in the
1925
current position as a vector of Ref<T>
1929
vect- reference to vector of Ref<T>(OUT parameter).
1932
Retrieves the column in the specified position as a vector of Ref<T>.
1933
The attribute at the current position should be a collection type (varray or
1934
nested table). The SQL type of the elements in the collection should be
1935
compatible with Ref<T>.
1941
compatible SQL types : REF
1945
void getVectorOfRefs( Statement *stmt, unsigned int index,
1946
OCCI_STD_NAMESPACE::vector <Ref<T> > &vect)
1948
OCCI_STD_NAMESPACE::vector<void *> vec_ref;
1949
getVectorOfOCIRefs(stmt, index, vec_ref);
1951
const Connection *sess = stmt->getConnection();
1954
unsigned int size = vec_ref.size();
1955
vect.reserve( size );
1956
for (unsigned int i=0; i< size; i++)
1958
if (vec_ref[i] == (OCIRef *)0)
1959
vect.push_back(Ref <T>()); // pushing a default-constructed Ref
1961
vect.push_back(Ref<T> (sess, (OCIRef *)vec_ref[i], FALSE));
1964
/*----------------------------- pinVectorOfRefs---------------------*/
1967
pinVectorOfRefs - array pin implementation
1970
conn- Connection object
1971
vecRef - vector of OCIRefs *
1972
vecCor - vector of OCIComplexObject *
1973
vecPOBj - vector of PObject * ( OUT )
1976
implements the array pin of refs passed and returns the corresponding
1984
void pinVectorOfRefs( const Connection *conn,
1985
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
1986
OCCI_STD_NAMESPACE::vector<T* > &vectObj, LockOptions lockOpt)
1989
OCCI_STD_NAMESPACE::vector<void *> vecRef;
1990
OCCI_STD_NAMESPACE::vector<void *> vecCor;
1991
OCCI_STD_NAMESPACE::vector<PObject *> vecPObj;
1992
unsigned int sz = vect.size();
1993
vecRef.reserve( sz );
1994
vecCor.reserve( sz );
1996
for ( unsigned int i=0; i < sz; i++)
1998
vecRef.push_back((void *)vect[i].getRef());
1999
vecCor.push_back((void *)vect[i].getCor());
2001
pinVectorOfOCIRefs(conn, vecRef, vecCor, vecPObj, lockOpt);
2002
for ( unsigned int k=0; k < sz; k++)
2004
vectObj.push_back((T *)vecPObj[k]);
2005
vect[k].setPinnedObject(vecPObj[k]);
2009
/*----------------------------- pinVectorOfRefs---------------------*/
2012
pinVectorOfRefs - array pin implementation
2015
conn- Connection object
2016
vecRef - vector of OCIRefs *
2017
vecCor - vector of OCIComplexObject *
2020
implements the array pin of refs passed
2027
void pinVectorOfRefs( const Connection *conn,
2028
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
2029
LockOptions lockOpt)
2032
OCCI_STD_NAMESPACE::vector<void *> vecRef;
2033
OCCI_STD_NAMESPACE::vector<void *> vecCor;
2034
OCCI_STD_NAMESPACE::vector<PObject *> vecPObj;
2035
unsigned int sz = vect.size();
2036
vecRef.reserve( sz );
2037
vecCor.reserve( sz );
2039
for ( unsigned int i=0; i < sz; i++)
2041
vecRef.push_back((void *)vect[i].getRef());
2042
vecCor.push_back((void *)vect[i].getCor());
2044
pinVectorOfOCIRefs(conn, vecRef, vecCor,vecPObj, lockOpt);
2045
for ( unsigned int k=0; k < sz; k++)
2046
vect[k].setPinnedObject(vecPObj[k]);
2051
/*---------------------------------------------------------------------------
2053
---------------------------------------------------------------------------*/
2056
} /* end of namespace occi */
2057
} /* end of namespace oracle */
2058
#endif /* OCCICONTROL_ORACLE */