oracledb 3.0.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +135 -8
- package/README.md +6 -4
- package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi48-linux-x64.node +0 -0
- package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi48-win32-x64.node +0 -0
- package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-linux-x64.node +0 -0
- package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-win32-x64.node +0 -0
- package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-linux-x64.node +0 -0
- package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-win32-x64.node +0 -0
- package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-linux-x64.node +0 -0
- package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-win32-x64.node +0 -0
- package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +1 -0
- package/lib/connection.js +18 -4
- package/lib/oracledb.js +44 -92
- package/lib/pool.js +36 -2
- package/lib/sodaCollection.js +1 -1
- package/lib/sodaDatabase.js +1 -1
- package/lib/util.js +82 -5
- package/package/README.md +32 -101
- package/package/install.js +139 -0
- package/package/prunebinaries.js +51 -0
- package/package.json +4 -11
- package/binding.gyp +0 -162
- package/lib/rel.txt +0 -1
- package/odpi/.npmignore +0 -4
- package/odpi/LICENSE.md +0 -218
- package/odpi/README.md +0 -61
- package/odpi/embed/README.md +0 -4
- package/odpi/embed/dpi.c +0 -50
- package/odpi/include/dpi.h +0 -1748
- package/odpi/src/dpiConn.c +0 -2089
- package/odpi/src/dpiContext.c +0 -296
- package/odpi/src/dpiData.c +0 -797
- package/odpi/src/dpiDebug.c +0 -184
- package/odpi/src/dpiDeqOptions.c +0 -370
- package/odpi/src/dpiEnqOptions.c +0 -174
- package/odpi/src/dpiEnv.c +0 -189
- package/odpi/src/dpiError.c +0 -204
- package/odpi/src/dpiErrorMessages.h +0 -86
- package/odpi/src/dpiGen.c +0 -303
- package/odpi/src/dpiGlobal.c +0 -292
- package/odpi/src/dpiHandleList.c +0 -117
- package/odpi/src/dpiHandlePool.c +0 -118
- package/odpi/src/dpiImpl.h +0 -1707
- package/odpi/src/dpiLob.c +0 -506
- package/odpi/src/dpiMsgProps.c +0 -386
- package/odpi/src/dpiObject.c +0 -897
- package/odpi/src/dpiObjectAttr.c +0 -115
- package/odpi/src/dpiObjectType.c +0 -326
- package/odpi/src/dpiOci.c +0 -3527
- package/odpi/src/dpiOracleType.c +0 -492
- package/odpi/src/dpiPool.c +0 -549
- package/odpi/src/dpiRowid.c +0 -136
- package/odpi/src/dpiSodaColl.c +0 -685
- package/odpi/src/dpiSodaCollCursor.c +0 -143
- package/odpi/src/dpiSodaDb.c +0 -432
- package/odpi/src/dpiSodaDoc.c +0 -230
- package/odpi/src/dpiSodaDocCursor.c +0 -143
- package/odpi/src/dpiStmt.c +0 -1797
- package/odpi/src/dpiSubscr.c +0 -674
- package/odpi/src/dpiUtils.c +0 -410
- package/odpi/src/dpiVar.c +0 -1794
- package/package/MAKEPKG.BAT +0 -156
- package/package/Makefile +0 -85
- package/package/createpackage.js +0 -186
- package/package/extractpackage.js +0 -76
- package/package/getversion.js +0 -37
- package/package/oracledbinstall.js +0 -497
- package/package/package.json +0 -54
- package/package/util.js +0 -286
- package/src/njsCommon.cpp +0 -1055
- package/src/njsCommon.h +0 -484
- package/src/njsConnection.cpp +0 -2926
- package/src/njsConnection.h +0 -227
- package/src/njsIntLob.cpp +0 -618
- package/src/njsIntLob.h +0 -179
- package/src/njsMessages.cpp +0 -122
- package/src/njsMessages.h +0 -118
- package/src/njsOracle.cpp +0 -1274
- package/src/njsOracle.h +0 -237
- package/src/njsPool.cpp +0 -482
- package/src/njsPool.h +0 -132
- package/src/njsResultSet.cpp +0 -478
- package/src/njsResultSet.h +0 -120
- package/src/njsSodaCollection.cpp +0 -507
- package/src/njsSodaCollection.h +0 -128
- package/src/njsSodaDatabase.cpp +0 -335
- package/src/njsSodaDatabase.h +0 -108
- package/src/njsSodaDocCursor.cpp +0 -203
- package/src/njsSodaDocCursor.h +0 -94
- package/src/njsSodaDocument.cpp +0 -412
- package/src/njsSodaDocument.h +0 -105
- package/src/njsSodaOperation.cpp +0 -557
- package/src/njsSodaOperation.h +0 -123
- package/src/njsSubscription.cpp +0 -388
- package/src/njsSubscription.h +0 -111
- package/src/njsUtils.cpp +0 -158
- package/src/njsUtils.h +0 -68
package/src/njsIntLob.h
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
/******************************************************************************
|
|
4
|
-
*
|
|
5
|
-
* You may not use the identified files except in compliance with the Apache
|
|
6
|
-
* License, Version 2.0 (the "License.")
|
|
7
|
-
*
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
*
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
* This file uses NAN:
|
|
19
|
-
*
|
|
20
|
-
* Copyright (c) 2015 NAN contributors
|
|
21
|
-
*
|
|
22
|
-
* NAN contributors listed at https://github.com/rvagg/nan#contributors
|
|
23
|
-
*
|
|
24
|
-
* Permission is hereby granted, free of charge, to any person obtaining
|
|
25
|
-
* a copy of this software and associated documentation files (the
|
|
26
|
-
* "Software"), to deal in the Software without restriction, including
|
|
27
|
-
* without limitation the rights to use, copy, modify, merge, publish,
|
|
28
|
-
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
29
|
-
* permit persons to whom the Software is furnished to do so, subject to
|
|
30
|
-
* the following conditions:
|
|
31
|
-
*
|
|
32
|
-
* The above copyright notice and this permission notice shall be
|
|
33
|
-
* included in all copies or substantial portions of the Software.
|
|
34
|
-
*
|
|
35
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
36
|
-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
37
|
-
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
38
|
-
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
39
|
-
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
40
|
-
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
41
|
-
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
42
|
-
*
|
|
43
|
-
* NAME
|
|
44
|
-
* njsILob.h
|
|
45
|
-
*
|
|
46
|
-
* DESCRIPTION
|
|
47
|
-
* ILob class
|
|
48
|
-
* ProtoILob class
|
|
49
|
-
*
|
|
50
|
-
******************************************************************************/
|
|
51
|
-
|
|
52
|
-
#ifndef __NJSILOB_H__
|
|
53
|
-
#define __NJSILOB_H__
|
|
54
|
-
|
|
55
|
-
#include <node.h>
|
|
56
|
-
#include <string>
|
|
57
|
-
#include "njsOracle.h"
|
|
58
|
-
#include "njsConnection.h"
|
|
59
|
-
|
|
60
|
-
using namespace v8;
|
|
61
|
-
using namespace node;
|
|
62
|
-
|
|
63
|
-
//-----------------------------------------------------------------------------
|
|
64
|
-
// njsProtoILob
|
|
65
|
-
// This is a helper class for ILob's contents to be mostly created in the
|
|
66
|
-
// worker thread. Basically, the njsProtoILob class is needed to create the
|
|
67
|
-
// attributes of the njsILob object in the worker thread as network round trips
|
|
68
|
-
// are required to get the length and the chunk size -- attributes which are
|
|
69
|
-
// available on the ILob object -- and no network round trips should be
|
|
70
|
-
// performed on the main thread (and Javascript objects cannot be created in
|
|
71
|
-
// worker threads).
|
|
72
|
-
//-----------------------------------------------------------------------------
|
|
73
|
-
|
|
74
|
-
class njsProtoILob {
|
|
75
|
-
friend class njsILob;
|
|
76
|
-
friend class njsConnection;
|
|
77
|
-
public:
|
|
78
|
-
|
|
79
|
-
njsProtoILob() : dpiLobHandle(NULL), dataType(NJS_DATATYPE_DEFAULT),
|
|
80
|
-
chunkSize(0), length(0), isAutoClose(false) {}
|
|
81
|
-
~njsProtoILob() {
|
|
82
|
-
if (dpiLobHandle) {
|
|
83
|
-
dpiLob_release(dpiLobHandle);
|
|
84
|
-
dpiLobHandle = NULL;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
bool PopulateFromDPI(njsBaton *baton, dpiLob *dpiLobHandle, bool addRef);
|
|
89
|
-
|
|
90
|
-
protected:
|
|
91
|
-
dpiLob *dpiLobHandle;
|
|
92
|
-
njsDataType dataType;
|
|
93
|
-
uint32_t chunkSize;
|
|
94
|
-
uint64_t length;
|
|
95
|
-
bool isAutoClose;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//-----------------------------------------------------------------------------
|
|
100
|
-
// njsILob
|
|
101
|
-
// Class used for wrapping LOBs.
|
|
102
|
-
//-----------------------------------------------------------------------------
|
|
103
|
-
class njsILob : public njsCommon {
|
|
104
|
-
public:
|
|
105
|
-
static void Init(Local<Object> target);
|
|
106
|
-
static Local<Object> CreateFromProtoLob(njsProtoILob *protoLob);
|
|
107
|
-
bool IsValid() const { return (dpiLobHandle) ? true : false; }
|
|
108
|
-
njsErrorType GetInvalidErrorType() const { return errInvalidLob; }
|
|
109
|
-
njsDataType GetDataType() const { return dataType; }
|
|
110
|
-
dpiLob *GetDPILobHandle() const { return dpiLobHandle; }
|
|
111
|
-
bool ClearDPILobHandle(njsBaton *baton);
|
|
112
|
-
static njsILob *GetInstance(Local<Value> val);
|
|
113
|
-
static bool HasInstance(Local<Value> val);
|
|
114
|
-
|
|
115
|
-
private:
|
|
116
|
-
njsILob() : dpiLobHandle(NULL), dataType(NJS_DATATYPE_DEFAULT),
|
|
117
|
-
bufferPtr(NULL), isAutoClose(false), pieceSize(0), chunkSize(0),
|
|
118
|
-
length(0), offset(0) {}
|
|
119
|
-
~njsILob() {
|
|
120
|
-
if (dpiLobHandle) {
|
|
121
|
-
dpiLob_release(dpiLobHandle);
|
|
122
|
-
dpiLobHandle = NULL;
|
|
123
|
-
}
|
|
124
|
-
if (bufferPtr) {
|
|
125
|
-
delete [] bufferPtr;
|
|
126
|
-
bufferPtr = NULL;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
static NAN_METHOD(New);
|
|
131
|
-
|
|
132
|
-
// Read Method on ILob class
|
|
133
|
-
static NAN_METHOD(Read);
|
|
134
|
-
static void Async_Read(njsBaton *baton);
|
|
135
|
-
static void Async_AfterRead(njsBaton *baton, Local<Value> argv[]);
|
|
136
|
-
|
|
137
|
-
// Write Method on ILob class
|
|
138
|
-
static NAN_METHOD(Write);
|
|
139
|
-
static void Async_Write(njsBaton *baton);
|
|
140
|
-
static void Async_AfterWrite(njsBaton *baton, Local<Value> argv[]);
|
|
141
|
-
|
|
142
|
-
// Close Method on ILob class
|
|
143
|
-
static NAN_METHOD(Close);
|
|
144
|
-
static void Async_Close(njsBaton *baton);
|
|
145
|
-
|
|
146
|
-
// Getters for properties
|
|
147
|
-
static NAN_GETTER(GetChunkSize);
|
|
148
|
-
static NAN_GETTER(GetLength);
|
|
149
|
-
static NAN_GETTER(GetPieceSize);
|
|
150
|
-
static NAN_GETTER(GetOffset);
|
|
151
|
-
static NAN_GETTER(GetType);
|
|
152
|
-
static NAN_GETTER(GetIsAutoClose);
|
|
153
|
-
static NAN_GETTER(GetIsValid);
|
|
154
|
-
|
|
155
|
-
// Setters for properties
|
|
156
|
-
static NAN_SETTER(SetChunkSize);
|
|
157
|
-
static NAN_SETTER(SetLength);
|
|
158
|
-
static NAN_SETTER(SetPieceSize);
|
|
159
|
-
static NAN_SETTER(SetOffset);
|
|
160
|
-
static NAN_SETTER(SetType);
|
|
161
|
-
static NAN_SETTER(SetIsAutoClose);
|
|
162
|
-
static NAN_SETTER(SetIsValid);
|
|
163
|
-
|
|
164
|
-
// attributes
|
|
165
|
-
dpiLob *dpiLobHandle;
|
|
166
|
-
njsDataType dataType;
|
|
167
|
-
char *bufferPtr;
|
|
168
|
-
bool isAutoClose;
|
|
169
|
-
uint32_t pieceSize;
|
|
170
|
-
uint32_t chunkSize;
|
|
171
|
-
uint64_t length;
|
|
172
|
-
uint64_t offset;
|
|
173
|
-
|
|
174
|
-
// Define ILob Constructor
|
|
175
|
-
static Nan::Persistent<FunctionTemplate> iLobTemplate_s;
|
|
176
|
-
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
#endif /** __NJSILOB_H__ **/
|
package/src/njsMessages.cpp
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/* Copyright (c) 2015, 2018, Oracle and/or its affiliates.
|
|
2
|
-
All rights reserved. */
|
|
3
|
-
|
|
4
|
-
/******************************************************************************
|
|
5
|
-
*
|
|
6
|
-
* You may not use the identified files except in compliance with the Apache
|
|
7
|
-
* License, Version 2.0 (the "License.")
|
|
8
|
-
*
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
* NAME
|
|
20
|
-
* njsMessages.cpp
|
|
21
|
-
*
|
|
22
|
-
* DESCRIPTION
|
|
23
|
-
* Static function composes a displayable (error) string with replacements
|
|
24
|
-
*
|
|
25
|
-
*****************************************************************************/
|
|
26
|
-
|
|
27
|
-
#include <stdio.h>
|
|
28
|
-
#include <stdarg.h>
|
|
29
|
-
#include <string>
|
|
30
|
-
using namespace std;
|
|
31
|
-
|
|
32
|
-
#include "njsMessages.h"
|
|
33
|
-
|
|
34
|
-
// Maximum buffer size to compose error message
|
|
35
|
-
#define NJS_MAX_ERROR_MSG_LEN 256
|
|
36
|
-
|
|
37
|
-
static const char *errMsg[] = {
|
|
38
|
-
"NJS-000: success", // errSuccess
|
|
39
|
-
"NJS-001: expected callback as last parameter", // errMissingCallback
|
|
40
|
-
"NJS-002: invalid pool", // errInvalidPool
|
|
41
|
-
"NJS-003: invalid connection", // errInvalidConnection
|
|
42
|
-
"NJS-004: invalid value for property %s", // errInvalidPropertyValue
|
|
43
|
-
"NJS-005: invalid value for parameter %d", // errInvalidParameterValue
|
|
44
|
-
"NJS-006: invalid type for parameter %d", // errInvalidParameterType
|
|
45
|
-
"NJS-007: invalid value for \"%s\" in parameter %d", // errInvalidPropertyValueInParam
|
|
46
|
-
"NJS-008: invalid type for \"%s\" in parameter %d", // errInvalidPropertyTypeInParam
|
|
47
|
-
"NJS-009: invalid number of parameters", // errInvalidNumberOfParameters
|
|
48
|
-
"NJS-010: unsupported data type %d in column %u", // errUnsupportedDataType
|
|
49
|
-
"NJS-011: encountered bind value and type mismatch", // errBindValueAndTypeMismatch
|
|
50
|
-
"NJS-012: encountered invalid bind data type in parameter %d", // errInvalidBindDataType
|
|
51
|
-
"NJS-013: invalid bind direction", // errInvalidBindDirection
|
|
52
|
-
"NJS-014: %s is a read-only property", // errReadOnly
|
|
53
|
-
"NJS-015: type was not specified for conversion", // errNoTypeForConversion
|
|
54
|
-
"NJS-016: buffer is too small for OUT binds", // errInsufficientBufferForBinds
|
|
55
|
-
"NJS-017: concurrent operations on ResultSet are not allowed", // errBusyResultSet
|
|
56
|
-
"NJS-018: invalid ResultSet", // errInvalidResultSet
|
|
57
|
-
"NJS-019: ResultSet cannot be returned for non-query statements", // errInvalidNonQueryExecution
|
|
58
|
-
"NJS-021: invalid type for conversion specified", // errInvalidTypeForConversion
|
|
59
|
-
"NJS-022: invalid Lob", // errInvalidLob
|
|
60
|
-
"NJS-023: concurrent operations on LOB are not allowed", // errBusyLob
|
|
61
|
-
"NJS-024: memory allocation failed", // errInsufficientMemory
|
|
62
|
-
"NJS-025: overflow when calculating results area size", // errResultsTooLarge
|
|
63
|
-
"NJS-026: maxRows must be greater than zero", // errInvalidmaxRows
|
|
64
|
-
"NJS-027: unexpected SQL parsing error", // errSQLSyntaxError
|
|
65
|
-
"NJS-029: invalid object from JavaScript", // errInvalidJSObject
|
|
66
|
-
"NJS-030: connection cannot be released because Lob operations are in progress", // errBusyConnLOB
|
|
67
|
-
"NJS-031: connection cannot be released because ResultSet operations are in progress", // errBusyConnRS
|
|
68
|
-
"NJS-032: connection cannot be released because a database call is in progress", // errBusyConnDB
|
|
69
|
-
"NJS-033: an internal error occurred. [%s][%s]", // errInternalError
|
|
70
|
-
"NJS-034: data type is unsupported for array bind", // errInvalidTypeForArrayBind
|
|
71
|
-
"NJS-035: maxArraySize is required for IN OUT array bind", // errReqdMaxArraySize
|
|
72
|
-
"NJS-036: given array is of size greater than maxArraySize", // errInvalidArraySize
|
|
73
|
-
"NJS-037: invalid data type at array index %d for bind \"%s\"", // errIncompatibleTypeArrayBind
|
|
74
|
-
"NJS-038: maxArraySize value should be greater than zero", // errInvalidValueArrayBind
|
|
75
|
-
"NJS-040: connection request timeout", // errConnRequestTimeout
|
|
76
|
-
"NJS-041: cannot convert ResultSet to QueryStream after invoking methods", // errCannotConvertRsToStream
|
|
77
|
-
"NJS-042: cannot invoke ResultSet methods after converting to QueryStream", // errCannotInvokeRsMethods
|
|
78
|
-
"NJS-043: ResultSet already converted to QueryStream", // errResultSetAlreadyConverted
|
|
79
|
-
"NJS-044: named JSON object is not expected in this context", // errNamedJSON
|
|
80
|
-
"NJS-045: cannot load the oracledb add-on binary", // errCannotLoadBinary
|
|
81
|
-
"NJS-046: pool alias \"%s\" already exists in the connection pool cache", // errPoolWithAliasAlreadyExists
|
|
82
|
-
"NJS-047: pool alias \"%s\" not found in connection pool cache", // errPoolWithAliasNotFound
|
|
83
|
-
"NJS-052: invalid data type at array index %d for bind position %d", // errIncompatibleTypeArrayIndexBind
|
|
84
|
-
"NJS-053: array value expected, a non-array value provided", //errNonArrayProvided
|
|
85
|
-
"NJS-054: Binary build/Release/oracledb.node was not installed from %s", // errNoBinaryInstalled
|
|
86
|
-
"NJS-055: Binding by position and name cannot be mixed", // errMixedBind
|
|
87
|
-
"NJS-056: maxSize must be specified and not zero for bind position %u", // errMissingMaxSizeByPos
|
|
88
|
-
"NJS-057: maxSize must be specified and not zero for bind \"%s\"", // errMissingMaxSizeByName
|
|
89
|
-
"NJS-058: maxSize of %u is too small for value of length %u in row %u", // errMaxSizeTooSmall
|
|
90
|
-
"NJS-059: type must be specified for bind position %u", // errMissingTypeByPos
|
|
91
|
-
"NJS-060: type must be specified for bind \"%s\"", // errMissingTypeByName
|
|
92
|
-
"NJS-061: invalid subscription", // errInvalidSubscription
|
|
93
|
-
"NJS-062: subscription notification callback missing", // errMissingSubscrCallback
|
|
94
|
-
"NJS-063: subscription notification SQL missing", // errMissingSubscrSql
|
|
95
|
-
"NJS-064: connection pool is closing", // errPoolClosing
|
|
96
|
-
"NJS-065: connection pool was closed", // errPoolClosed
|
|
97
|
-
"NJS-066: invalid SODA document cursor", // errInvalidSodaDocCursor
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
//-----------------------------------------------------------------------------
|
|
102
|
-
// njsMessages::Get()
|
|
103
|
-
// Get a message given the error number and any number of arguments. If the
|
|
104
|
-
// error number doesn't fall within the valid error number range, an empty
|
|
105
|
-
// string is returned.
|
|
106
|
-
//-----------------------------------------------------------------------------
|
|
107
|
-
string njsMessages::Get(int err, ...)
|
|
108
|
-
{
|
|
109
|
-
char msg[NJS_MAX_ERROR_MSG_LEN + 1];
|
|
110
|
-
va_list vlist;
|
|
111
|
-
std::string str;
|
|
112
|
-
|
|
113
|
-
if ( err > 0 && err < errMaxErrors ) {
|
|
114
|
-
va_start (vlist, err);
|
|
115
|
-
if (vsnprintf(msg, NJS_MAX_ERROR_MSG_LEN, errMsg[err], vlist) <= 0)
|
|
116
|
-
msg[0] = '\0';
|
|
117
|
-
va_end (vlist);
|
|
118
|
-
str = msg;
|
|
119
|
-
}
|
|
120
|
-
return str;
|
|
121
|
-
}
|
|
122
|
-
|
package/src/njsMessages.h
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/* Copyright (c) 2015, 2018, Oracle and/or its affiliates.
|
|
2
|
-
All rights reserved. */
|
|
3
|
-
|
|
4
|
-
/******************************************************************************
|
|
5
|
-
*
|
|
6
|
-
* You may not use the identified files except in compliance with the Apache
|
|
7
|
-
* License, Version 2.0 (the "License.")
|
|
8
|
-
*
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0.
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
14
|
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
*
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*
|
|
19
|
-
* NAME
|
|
20
|
-
* njsMessages.h
|
|
21
|
-
*
|
|
22
|
-
* DESCRIPTION
|
|
23
|
-
* Error message consolidation and composing
|
|
24
|
-
* All error messages are stored in variable now and is displayed after
|
|
25
|
-
* any substitution. These messages can be exported to a text file for
|
|
26
|
-
* localization later
|
|
27
|
-
*
|
|
28
|
-
*****************************************************************************/
|
|
29
|
-
|
|
30
|
-
#ifndef __NJSMESSAGES_H__
|
|
31
|
-
#define __NJSMESSAGES_H__
|
|
32
|
-
|
|
33
|
-
#include <string>
|
|
34
|
-
using namespace std;
|
|
35
|
-
|
|
36
|
-
//-----------------------------------------------------------------------------
|
|
37
|
-
// njsErrorType
|
|
38
|
-
// Enumeration for all error messages used within the driver.
|
|
39
|
-
//-----------------------------------------------------------------------------
|
|
40
|
-
typedef enum {
|
|
41
|
-
errSuccess = 0,
|
|
42
|
-
errMissingCallback,
|
|
43
|
-
errInvalidPool,
|
|
44
|
-
errInvalidConnection,
|
|
45
|
-
errInvalidPropertyValue,
|
|
46
|
-
errInvalidParameterValue,
|
|
47
|
-
errInvalidParameterType,
|
|
48
|
-
errInvalidPropertyValueInParam,
|
|
49
|
-
errInvalidPropertyTypeInParam,
|
|
50
|
-
errInvalidNumberOfParameters,
|
|
51
|
-
errUnsupportedDataType,
|
|
52
|
-
errBindValueAndTypeMismatch,
|
|
53
|
-
errInvalidBindDataType,
|
|
54
|
-
errInvalidBindDirection,
|
|
55
|
-
errReadOnly,
|
|
56
|
-
errNoTypeForConversion,
|
|
57
|
-
errInsufficientBufferForBinds,
|
|
58
|
-
errBusyResultSet,
|
|
59
|
-
errInvalidResultSet,
|
|
60
|
-
errInvalidNonQueryExecution,
|
|
61
|
-
errInvalidTypeForConversion,
|
|
62
|
-
errInvalidLob,
|
|
63
|
-
errBusyLob,
|
|
64
|
-
errInsufficientMemory,
|
|
65
|
-
errResultsTooLarge,
|
|
66
|
-
errInvalidmaxRows,
|
|
67
|
-
errSQLSyntaxError,
|
|
68
|
-
errInvalidJSObject,
|
|
69
|
-
errBusyConnLOB,
|
|
70
|
-
errBusyConnRS,
|
|
71
|
-
errBusyConnDB,
|
|
72
|
-
errInternalError,
|
|
73
|
-
errInvalidTypeForArrayBind,
|
|
74
|
-
errReqdMaxArraySize,
|
|
75
|
-
errInvalidArraySize,
|
|
76
|
-
errIncompatibleTypeArrayBind,
|
|
77
|
-
errInvalidValueArrayBind,
|
|
78
|
-
errConnRequestTimeout,
|
|
79
|
-
errCannotConvertRsToStream,
|
|
80
|
-
errCannotInvokeRsMethods,
|
|
81
|
-
errResultSetAlreadyConverted,
|
|
82
|
-
errNamedJSON,
|
|
83
|
-
errCannotLoadBinary,
|
|
84
|
-
errPoolWithAliasAlreadyExists,
|
|
85
|
-
errPoolWithAliasNotFound,
|
|
86
|
-
errIncompatibleTypeArrayIndexBind,
|
|
87
|
-
errNonArrayProvided,
|
|
88
|
-
errNoBinaryInstalled,
|
|
89
|
-
errMixedBind,
|
|
90
|
-
errMissingMaxSizeByPos,
|
|
91
|
-
errMissingMaxSizeByName,
|
|
92
|
-
errMaxSizeTooSmall,
|
|
93
|
-
errMissingTypeByPos,
|
|
94
|
-
errMissingTypeByName,
|
|
95
|
-
errInvalidSubscription,
|
|
96
|
-
errMissingSubscrCallback,
|
|
97
|
-
errMissingSubscrSql,
|
|
98
|
-
errPoolClosing,
|
|
99
|
-
errPoolClosed,
|
|
100
|
-
errInvalidSodaDocCursor,
|
|
101
|
-
|
|
102
|
-
// New ones should be added here
|
|
103
|
-
|
|
104
|
-
errMaxErrors // Max # of errors plus one
|
|
105
|
-
} njsErrorType;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
//-----------------------------------------------------------------------------
|
|
109
|
-
// njsMessages
|
|
110
|
-
// Class used for producing error messages.
|
|
111
|
-
//-----------------------------------------------------------------------------
|
|
112
|
-
class njsMessages {
|
|
113
|
-
public:
|
|
114
|
-
static string Get(int err, ...);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
#endif /* __NJSMESSAGES_H__ */
|
|
118
|
-
|