@@ -323,13 +323,15 @@ queries from returning unexpectedly large numbers of rows.
323
323
324
324
<a name =" propdboutformat " ></a >
325
325
```
326
- String outFormat
326
+ Number outFormat
327
327
```
328
328
329
329
The format of rows fetched by the ` execute() ` call. This can be either
330
- ` ARRAY ` or ` OBJECT ` . If specified as ` ARRAY ` , each row is fetched as an
331
- array of column values. The default value is ` ARRAY ` , which is more
332
- efficient.
330
+ of the [ Oracledb constants] ( #oracledbconstants ) ` ARRAY ` or ` OBJECT ` .
331
+ The default value is ` ARRAY ` which is more efficient.
332
+
333
+ If specified as ` ARRAY ` , each row is fetched as an array of column
334
+ values.
333
335
334
336
If specified as ` OBJECT ` , each row is fetched as a JavaScript object.
335
337
The object has a property for each column name, with the property
@@ -1144,7 +1146,7 @@ Callback function parameter | Description
1144
1146
## <a name =" connectionhandling " ></a > 6. Connection Handling
1145
1147
1146
1148
Connections can be created directly by * Oracledb*
1147
- [ getConnection()] ( #getconnectiondb ) :
1149
+ [ ` getConnection() ` ] ( #getconnectiondb ) :
1148
1150
1149
1151
``` javascript
1150
1152
var oracledb = require (' oracledb' );
@@ -1155,12 +1157,18 @@ oracledb.getConnection(
1155
1157
password : " welcome" ,
1156
1158
connectString : " localhost/XE"
1157
1159
},
1158
- . . .
1159
- );
1160
+ function (err , connection )
1161
+ {
1162
+ if (err) {
1163
+ console .error (err .message );
1164
+ return ;
1165
+ }
1166
+ . . .
1167
+ });
1160
1168
```
1161
1169
1162
1170
Alternatively connections can be obtained from * Pool*
1163
- [ getConnection()] ( #getconnectionpool ) :
1171
+ [ ` getConnection() ` ] ( #getconnectionpool ) :
1164
1172
1165
1173
1166
1174
``` javascript
@@ -1188,10 +1196,43 @@ recycled. However, in situations where connections are used
1188
1196
infrequently, direct connections may be more efficient than using a
1189
1197
connection pool.
1190
1198
1199
+ Connections should be released with [ ` release() ` ] ( #release ) when no
1200
+ longer needed:
1201
+
1202
+ ``` javascript
1203
+ var oracledb = require (' oracledb' );
1204
+
1205
+ oracledb .getConnection (
1206
+ {
1207
+ user : " hr" ,
1208
+ password : " welcome" ,
1209
+ connectString : " localhost/XE"
1210
+ },
1211
+ function (err , connection )
1212
+ {
1213
+ if (err) {
1214
+ console .error (err .message );
1215
+ return ;
1216
+ }
1217
+
1218
+ . . .
1219
+
1220
+ connection .release (
1221
+ function (err )
1222
+ {
1223
+ console .error (err .message );
1224
+ return ;
1225
+ });
1226
+ });
1227
+ ```
1228
+
1229
+ This is particularly true with connection pools. Pooled connections
1230
+ should also be released before calling [ ` terminate() ` ] ( #terminate ) .
1231
+
1191
1232
### <a name =" connectionstrings " ></a > 6.1 Connection Strings
1192
1233
1193
- The * Oracledb* [ getConnection()] ( #getconnectiondb ) and * Pool*
1194
- [ getConnection()] ( #getconnectionpool ) ` connectString ` can be an
1234
+ The * Oracledb* [ ` getConnection() ` ] ( #getconnectiondb ) and * Pool*
1235
+ [ ` getConnection() ` ] ( #getconnectionpool ) ` connectString ` can be an
1195
1236
Easy Connect string, or a Connect Name from a ` tnsnames.ora ` file, or
1196
1237
the name of a local Oracle database instance.
1197
1238
0 commit comments