Skip to content

Commit 5448ebd

Browse files
committed
Major update for TimesTen 18.1.4.1.0.
Lots of minor changes and improvements. Leverage capabilities in TimesTen 18.1.4.1.0. Requires TimesTen 18.1.4.1.0.
1 parent 7a7ee2c commit 5448ebd

File tree

263 files changed

+4319
-2157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+4319
-2157
lines changed

Diff for: README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ This repository stores a variety of examples demonstrating how to use the Oracle
77
| [quickstart](./quickstart) | Classic QuickStart and Scaleout samples. See the README file in that directory for more information. |
88
| [cloud](./cloud) | Scripts to simplify deployment of TimesTen Scaleout in Oracle Cloud. See the README file in that directory for more information. |
99
| [languages](./languages) | Open Source language support samples (Python and Node.js) |
10-
10+
11+
## Supported TimesTen Releases
12+
These samples require a _minimum_ of **TimesTen 18.1.4.1.0** but our recommendation is to always use the most recent release available for your platform.
1113

1214
## More information
1315
You can find more information about the Oracle TimesTen In-Memory Database on our [Product Portal](https://www.oracle.com/database/technologies/related/timesten.html)

Diff for: VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
oracle-timesten-samples version 8
1+
oracle-timesten-samples version 11

Diff for: cloud/VERSION.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Oracle TimesTen Scaleout Cloud Scripts 1.1

Diff for: cloud/ottscaleout/.checksum

-1
This file was deleted.

Diff for: languages/nodejs/README.md

+52-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
1+
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
2+
3+
# TimesTen Node.js Samples
24

3-
# TimesTen Node.js Samples
4-
55
This folder contains Node.js samples that illustrate database connection and operations using the node-oracledb driver against TimesTen databases.
66

77
## Software & Platform Support
88
The following table describes the tested operating systems, node-oracledb driver and TimesTen software versions.
99

1010
OS | Node.js Version | node-oracledb Driver Version | TimesTen Client Driver | TimesTen Direct Driver
1111
------------- | ------- | ------------- | ------------ | ------
12-
Linux 64-bit | 12.7.0 |4.0.1 | 18.1.3.1.0+ | 18.1.3.1.0+
13-
macOS | 12.7.0 |4.0.1 | 18.1.3.1.0+ | N/A
14-
MS Windows 64-bit | 12.7.0 | 4.0.1 | 18.1.3.1.0+ | N/A
12+
Linux 64-bit | 12.7.0 |4.0.1+ | 18.1.4.1.0+ | 18.1.4.1.0+
13+
macOS | 12.7.0 |4.0.1+ | 18.1.4.1.0+ | N/A
14+
MS Windows 64-bit | 12.7.0 | 4.0.1+ | 18.1.4.1.0+ | N/A
1515

16-
**NOTE**: Access to TimesTen Databases on any supported TimesTen server platforms can be achieved using the TimesTen client driver from any of the platforms listed above. For more information on supported TimesTen platforms, see [TimesTen Release Notes](https://docs.oracle.com/database/timesten-18.1/TTREL/toc.htm).
16+
**NOTE**: Access to TimesTen Databases on any supported TimesTen server platforms can be achieved using the TimesTen client driver from any of the platforms listed above. For more information on supported TimesTen platforms, see [TimesTen Release Notes](https://www.oracle.com/a/tech/docs/readme.html
17+
).
1718

1819

1920
## PRE-REQUISITES
20-
21+
2122
1. Node.js language is installed.
2223
2. The node-oracledb driver is installed.
2324
3. A TimesTen database is created and data source is setup to access that database.
@@ -26,14 +27,14 @@ MS Windows 64-bit | 12.7.0 | 4.0.1 | 18.1.3.1.0+ | N/A
2627
For more information on setup, see [TimesTen In-Memory Database Open Source Languages Support Guide](https://docs.oracle.com/database/timesten-18.1/TTOSL/toc.htm).
2728

2829
## Known Problems and Limitations
29-
* REF CURSORs are currently not supported.
30-
* Using the NVARCHAR/NCHAR data types for input parameters in a PL/SQL procedure is currently not supported.
31-
* Large objects (LOBs) are currently not supported.
30+
31+
* NVARCHAR/NCHAR data types in a Node.js application are encoded as UTF-16, the [same difference between Oracle and TimesTen](https://docs.oracle.com/database/timesten-18.1/TTCAC/oracle_tt.htm#TTCAC353) as noted in the TimesTen Documentation.
32+
* Fetching a clob inside a stored procedure through a Node.js application can result in error ORA-00600.
3233
* DML statements with RETURN INTO are currently not supported.
3334
* The value returned for the sub-second field of a PL/SQL output parameter of type Timestamp may be incorrect.
3435

35-
36-
36+
37+
3738
## Node.js sample programs
3839
### Download Samples
3940

@@ -68,7 +69,7 @@ Table has been dropped
6869
Connection has been released
6970
```
7071

71-
72+
7273
### sql.js
7374
The sql sample program connects to a TimesTen database and performs the following operations:
7475

@@ -123,7 +124,7 @@ The queriesAndPlsql sample program connects to a TimesTen database and performs
123124
* Calls a PL/SQL procedure to update a row
124125
* Calls a PL/SQL procedure to delete a row
125126
* Drops the table
126-
* Disconnects from the database
127+
* Disconnects from the database
127128

128129
Example:
129130

@@ -142,8 +143,41 @@ Delete a row using an anonymous block ...
142143
Connection has been released
143144
144145
```
146+
### lobs.js
147+
148+
The lobs sample program connects to a TimesTen database and performs a number of database operations against a CLOB data type table:
149+
150+
151+
* Creates a table named "CLOB"
152+
* Populates the table
153+
* Performs Select/fetching row
154+
* Disconnects from the database
155+
156+
Example:
157+
158+
```
159+
% node lobs.js -u username -p password
160+
> Connecting
161+
> Creating table with CLOB column
162+
> Reading file
163+
> Populating CLOB from file
164+
> Querying CLOB column
165+
> Reading CLOB
166+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce facilisis lacinia mauris et sodales. Ut non ligula eget lorem elementum maximus. Fusce pretium, felis a ultrices sodales, ligula augue ullamcorper eros, nec accumsan risus diam id justo. Mauris sed dictum nunc, vitae vehicula felis. Praesent et sodales odio. Nunc pulvinar ipsum ac erat iaculis efficitur. Nunc in aliquet est. Donec porta est est, nec iaculis leo lacinia at.
167+
168+
Nunc quis sodales sem. Nam felis dolor, cursus volutpat cursus vel, tempus nec mauris. Morbi bibendum urna nec leo commodo, id pellentesque nisi dictum. Vivamus venenatis velit nec orci imperdiet sagittis. Praesent fermentum, tortor sed tempus condimentum, lectus ipsum condimentum diam, at facilisis ligula purus vitae neque. Quisque erat quam, tristique at nisl sed, mattis feugiat diam. Curabitur ipsum nibh, mollis at venenatis nec, rutrum eu quam. Fusce augue tellus, porta ut dapibus at, ornare ut nisi. In imperdiet elit non dolor pharetra, quis bibendum odio aliquam. Quisque porttitor tempus augue eu consequat. Cras ac metus malesuada, pellentesque tortor in, porta leo.
169+
170+
Aliquam erat volutpat. Duis vitae quam id est maximus commodo. Morbi dolor lacus, bibendum ac nisl nec, fringilla eleifend nibh. Proin a tellus rhoncus, fermentum magna sed, imperdiet nibh. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam sed consequat nisi. Morbi tortor ipsum, consequat a suscipit sed, ullamcorper ut massa.
171+
172+
Aliquam erat volutpat. Maecenas porttitor vel sapien non viverra. Sed dignissim luctus lectus at cursus. Sed condimentum at massa in egestas. In sed dui eget augue posuere finibus. Etiam pulvinar libero sit amet magna efficitur scelerisque. Sed pretium, turpis in condimentum blandit, risus tortor venenatis nisl, facilisis luctus mauris metus ut sem. Proin dapibus sit amet nunc a ultricies. Phasellus interdum lobortis leo sed fermentum. Phasellus ac aliquam erat. Duis at ultricies urna. Nulla at pharetra dolor, id sodales sapien. Ut auctor mi cras amet.
173+
174+
> Finished reading CLOB
175+
> Connection released
176+
177+
178+
```
179+
145180

146181

147-
148-
## Documentation
149-
You can find the online documentation for Oracle TimesTen In-Memory Database in the [Documentation Library](https://docs.oracle.com/database/timesten-18.1/). Online documenation for the node-oracledb driver can be found [here](https://oracle.github.io/node-oracledb/doc/api.html).
182+
## Documentation
183+
You can find the online documentation for Oracle TimesTen In-Memory Database in the [Documentation Library](https://docs.oracle.com/database/timesten-18.1/). Online documentation for the node-oracledb driver can be found [here](https://oracle.github.io/node-oracledb/doc/api.html).

Diff for: languages/nodejs/VERSION.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Oracle TimesTen Samples NodeJS 1.0.0.0.0
2-
1+
Oracle TimesTen NodeJS Samples version 1.1

Diff for: languages/nodejs/lobs.js

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3+
*
4+
* Licensed under the Universal Permissive License v 1.0 as shown
5+
* at http://oss.oracle.com/licenses/upl
6+
*
7+
* DESCRIPTION
8+
* Writing a CLOB synchronously from a file and
9+
* reading its content asynchronously using a stream.
10+
*/
11+
'use strict';
12+
var fs = require('fs');
13+
var oracledb = require('oracledb');
14+
var accessControl = require('./AccessControl');
15+
16+
// Execute the sample
17+
run(lobSample);
18+
19+
// 1. Creates a table with a CLOB column
20+
// 2. Inserts a CLOB from a string
21+
// 3. Reads the CLOB as a stream
22+
//
23+
async function lobSample(conn) {
24+
let result;
25+
26+
console.log("> Creating table with CLOB column");
27+
try { await conn.execute("DROP TABLE clobs") } catch (err) { }
28+
await conn.execute("CREATE TABLE clobs (id NUMBER, text CLOB)");
29+
30+
console.log("> Reading file");
31+
let str = fs.readFileSync(__dirname + '/text.txt', 'utf8');
32+
33+
console.log("> Populating CLOB from file");
34+
result = await conn.execute(
35+
"INSERT INTO clobs VALUES (1, :colClob)",
36+
{ colClob: str}
37+
);
38+
39+
// Get the LOB for reading
40+
console.log("> Querying CLOB column");
41+
result = await conn.execute("SELECT text FROM clobs where id=1");
42+
let outClob = result.rows[0][0];
43+
44+
console.log("> Reading CLOB");
45+
await new Promise( (resolve, reject) => {
46+
outClob.on("data", chunk => console.log(chunk.toString()));
47+
outClob.on("error", error => reject(error));
48+
outClob.on("end", () => {
49+
console.log("> Finished reading CLOB");
50+
resolve();
51+
});
52+
} );
53+
}
54+
55+
56+
// Connects to the database and executes `cb', passing the
57+
// connection object as a parameter
58+
async function run(cb) {
59+
let connection;
60+
try {
61+
console.log("> Connecting");
62+
let credentials = accessControl.getCredentials("lobs.js");
63+
connection = await oracledb.getConnection({
64+
user: credentials['-u'], password: credentials['-p'],
65+
connectString: credentials['-c']
66+
});
67+
68+
await cb(connection);
69+
}
70+
catch (err) {
71+
console.log(err);
72+
}
73+
finally {
74+
if (connection) {
75+
try {
76+
connection.close();
77+
console.log("> Connection released");
78+
}
79+
catch (err) { console.log(err);}
80+
}
81+
}
82+
}
83+

Diff for: languages/python/README.md

+49-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
1+
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
2+
3+
# TimesTen Python Samples
24

3-
# TimesTen Python Samples
4-
55
This folder contains Python samples that illustrate database connection and operations using the cx_Oracle driver against the TimesTen database.
66

77
## Software & Platform Support
88
The following table describes the tested operating systems, cx_Oracle driver and TimesTen software versions.
99

1010
OS | Python Version | cx_Oracle Driver Version | TimesTen Client Driver | TimesTen Direct Driver
1111
------------- | --------- | --------- | ------------| ------
12-
Linux 64-bit | 3.7.5 | 7.2.2+ | 18.1.3.1.0+ | 18.1.3.1.0+
13-
macOS | 3.7.5 |7.2.2+ | 18.1.3.1.0+ | N/A
14-
MS Windows 64-bit | 3.7.5 |7.2.2+ | 18.1.3.1.0+| N/A
12+
Linux 64-bit | 3.7.5 | 7.2.2+ | 18.1.4.1.0+ | 18.1.4.1.0+
13+
macOS | 3.7.5 |7.2.2+ | 18.1.4.1.0+ | N/A
14+
MS Windows 64-bit | 3.7.5 |7.2.2+ | 18.1.4.1.0+| N/A
1515

1616
**NOTE**: Access to TimesTen Databases on any supported TimesTen server platforms can be achieved using the TimesTen client driver from any of the platforms listed above. For more information on supported TimesTen platforms, see [TimesTen Release Notes](https://docs.oracle.com/database/timesten-18.1/TTREL/toc.htm).
1717

18-
**NOTE2**: Python version 2.7 also works against TimesTen databases even though it's not listed in the official tested chart above.
18+
**NOTE2**: Python version 2.7 also works against TimesTen databases even though it's not listed in the chart above.
1919

2020

2121

2222
## PRE-REQUISITES
23-
23+
2424
1. Python language is installed.
2525
2. The cx_Oracle driver for Python is installed.
2626
3. A TimesTen database is created and data source is setup to access that database.
@@ -29,14 +29,13 @@ MS Windows 64-bit | 3.7.5 |7.2.2+ | 18.1.3.1.0+| N/A
2929
For more information on setup, see [TimesTen In-Memory Database Open Source Languages Support Guide](https://docs.oracle.com/database/timesten-18.1/TTOSL/toc.htm).
3030

3131
## Known Problems and Limitations
32-
* REF CURSORs are currently not supported.
33-
* Using the NVARCHAR/NCHAR data types for input parameters in a PL/SQL procedure is currently not supported.
34-
* Large objects (LOBs) are currently not supported.
32+
33+
* NVARCHAR/NCHAR data types in a Python application are encoded as UTF-16, the [same difference between Oracle and TimesTen](https://docs.oracle.com/database/timesten-18.1/TTCAC/oracle_tt.htm#TTCAC353) as noted in the TimesTen Documentation.
3534
* DML statements with RETURN INTO are currently not supported.
3635
* The value returned for the sub-second field of a PL/SQL output parameter of type Timestamp may incorrect.
3736
* When using the built-in procedures ttRepStateSave() & ttRepSubscriberWait() to set the replication state from a Python applications, the operation may take some time to take effect. Your application should wait much longer than the set waitTime specified in the call to ttRepSubscriberWait() to avoid timeouts.
38-
39-
37+
38+
4039
## Python Sample Programs
4140
### Download Samples
4241

@@ -71,7 +70,7 @@ Table has been dropped
7170
Connection has been released
7271
7372
```
74-
73+
7574
### sql.py
7675

7776
This Python sample program connects to a TimesTen Database and performs the following operations:
@@ -128,7 +127,7 @@ This Python sample program connects to a TimesTen Database and performs a number
128127
* Calls a PL/SQL procedure to update a row
129128
* Calls a PL/SQL procedure to delete a row
130129
* Drops the table
131-
* Disconnects from the database
130+
* Disconnects from the database
132131

133132
Example:
134133

@@ -146,8 +145,41 @@ Delete a row using an anonymous block ...
146145
Rows after delete = 99
147146
Connection has been released
148147
148+
```
149+
### lobs.py
150+
151+
The lobs sample program connects to a TimesTen database and performs a number of database operations against a CLOB data type table:
152+
153+
154+
* Creates a table named "CLOB"
155+
* Populates the table
156+
* Performs Select/fetching row
157+
* Disconnects from the database
158+
159+
Example:
160+
161+
```
162+
% python3 lobs.py -u appuser -p appuser
163+
> Connecting
164+
> Creating table with CLOB column
165+
> Reading file
166+
> Populating CLOB from file
167+
> Querying CLOB column
168+
> Reading CLOB
169+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce facilisis lacinia mauris et sodales. Ut non ligula eget lorem elementum maximus. Fusce pretium, felis a ultrices sodales, ligula augue ullamcorper eros, nec accumsan risus diam id justo. Mauris sed dictum nunc, vitae vehicula felis. Praesent et sodales odio. Nunc pulvinar ipsum ac erat iaculis efficitur. Nunc in aliquet est. Donec porta est est, nec iaculis leo lacinia at.
170+
171+
Nunc quis sodales sem. Nam felis dolor, cursus volutpat cursus vel, tempus nec mauris. Morbi bibendum urna nec leo commodo, id pellentesque nisi dictum. Vivamus venenatis velit nec orci imperdiet sagittis. Praesent fermentum, tortor sed tempus condimentum, lectus ipsum condimentum diam, at facilisis ligula purus vitae neque. Quisque erat quam, tristique at nisl sed, mattis feugiat diam. Curabitur ipsum nibh, mollis at venenatis nec, rutrum eu quam. Fusce augue tellus, porta ut dapibus at, ornare ut nisi. In imperdiet elit non dolor pharetra, quis bibendum odio aliquam. Quisque porttitor tempus augue eu consequat. Cras ac metus malesuada, pellentesque tortor in, porta leo.
172+
173+
Aliquam erat volutpat. Duis vitae quam id est maximus commodo. Morbi dolor lacus, bibendum ac nisl nec, fringilla eleifend nibh. Proin a tellus rhoncus, fermentum magna sed, imperdiet nibh. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam sed consequat nisi. Morbi tortor ipsum, consequat a suscipit sed, ullamcorper ut massa.
174+
175+
Aliquam erat volutpat. Maecenas porttitor vel sapien non viverra. Sed dignissim luctus lectus at cursus. Sed condimentum at massa in egestas. In sed dui eget augue posuere finibus. Etiam pulvinar libero sit amet magna efficitur scelerisque. Sed pretium, turpis in condimentum blandit, risus tortor venenatis nisl, facilisis luctus mauris metus ut sem. Proin dapibus sit amet nunc a ultricies. Phasellus interdum lobortis leo sed fermentum. Phasellus ac aliquam erat. Duis at ultricies urna. Nulla at pharetra dolor, id sodales sapien. Ut auctor mi cras amet.
176+
177+
> Finished reading CLOB
178+
> Connection released
179+
180+
149181
```
150182

151183

152-
## Documentation
153-
You can find the online documentation for Oracle TimesTen In-Memory Database in the [Documentation Library](https://docs.oracle.com/database/timesten-18.1/). Online documenation for the cx_Oracle driver can be found [here](https://cx-oracle.readthedocs.io/en/latest/).
184+
## Documentation
185+
You can find the online documentation for Oracle TimesTen In-Memory Database in the [Documentation Library](https://docs.oracle.com/database/timesten-18.1/). Online documenation for the cx_Oracle driver can be found [here](https://cx-oracle.readthedocs.io/en/latest/).

Diff for: languages/python/VERSION.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Oracle TimesTen Samples Python 1.0.0.0.0
1+
Oracle TimesTen Python Samples version 1.1

0 commit comments

Comments
 (0)