From ae82232f05cd1f7d5a6f561ee5f594d31a1f8e8d Mon Sep 17 00:00:00 2001 From: Marcos Arancibia <31939976+marancibia@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:46:40 -0400 Subject: [PATCH 01/37] Updates and fixes to Sample Code (#399) Updates and fixes to two sets of examples for SQL code: Anomaly Detection and ESM Auto Model search. --- .../sql/23ai/oml4sql-anomaly-detection-em.sql | 26 +++++++------------ ...4sql-time-series-esm-auto-model-search.sql | 10 +++---- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/machine-learning/sql/23ai/oml4sql-anomaly-detection-em.sql b/machine-learning/sql/23ai/oml4sql-anomaly-detection-em.sql index 3202e4ae..d242cc32 100644 --- a/machine-learning/sql/23ai/oml4sql-anomaly-detection-em.sql +++ b/machine-learning/sql/23ai/oml4sql-anomaly-detection-em.sql @@ -9,15 +9,7 @@ -- -- https://oss.oracle.com/licenses/upl ----------------------------------------------------------------------- -SET ECHO ON -SET FEEDBACK 1 -SET NUMWIDTH 10 -SET LINESIZE 80 -SET TRIMSPOOL ON -SET TAB OFF -SET PAGESIZE 100 -SET serveroutput ON -SET pages 10000 + ----------------------------------------------------------------------- -- SAMPLE PROBLEM ----------------------------------------------------------------------- @@ -101,9 +93,9 @@ END; -- DISPLAY MODEL DETAILS -- -SELECT * -FROM TABLE(dbms_data_mining.get_model_details_global('CUSTOMERS360MODEL_AD')) -ORDER BY global_detail_name; +SELECT NAME, NUMERIC_VALUE +FROM DM$VGCUSTOMERS360MODEL_AD +ORDER BY NAME; --------------------------------------------- -- DISPLAY THE TOP 5 MOST ANOMALOUS CUSTOMERS @@ -114,7 +106,7 @@ FROM (SELECT CUST_ID, round(prob_anomalous,2) prob_anomalous, YRS_RESIDENCE, CUST_MARITAL_STATUS, rank() over (ORDER BY prob_anomalous DESC) rnk FROM (SELECT CUST_ID, HOUSEHOLD_SIZE, YRS_RESIDENCE, CUST_GENDER, CUST_MARITAL_STATUS, - prediction_probability(CUSTOMERS360MODEL, '0' USING *) prob_anomalous + prediction_probability(CUSTOMERS360MODEL_AD, '0' USING *) prob_anomalous FROM CUSTOMERS360_V)) WHERE rnk <= 5 ORDER BY prob_anomalous DESC; @@ -147,10 +139,10 @@ SELECT CUST_ID, PREDICTION, RTRIM(TRIM(SUBSTR(OUTPRED."Attribute2",17,100)),'rank="2"/>') SECOND_ATTRIBUTE, RTRIM(TRIM(SUBSTR(OUTPRED."Attribute3",17,100)),'rank="3"/>') THIRD_ATTRIBUTE FROM (SELECT CUST_ID, - PREDICTION(CUSTOMERS360MODEL USING *) PREDICTION, - PREDICTION_DETAILS(CUSTOMERS360MODEL, '0' USING *) PREDICTION_DETAILS + PREDICTION(CUSTOMERS360MODEL_AD USING *) PREDICTION, + PREDICTION_DETAILS(CUSTOMERS360MODEL_AD, '0' USING *) PREDICTION_DETAILS FROM CUSTOMERS360_V - WHERE PREDICTION_PROBABILITY(CUSTOMERS360MODEL, '0' USING *) > 0.50 + WHERE PREDICTION_PROBABILITY(CUSTOMERS360MODEL_AD, '0' USING *) > 0.50 AND OCCUPATION = 'TechSup' ORDER BY CUST_ID) OUT, XMLTABLE('/Details' @@ -164,4 +156,4 @@ FETCH FIRST 10 ROWS ONLY; ----------------------------------------------------------------------- -- End of script ------------------------------------------------------------------------ \ No newline at end of file +----------------------------------------------------------------------- diff --git a/machine-learning/sql/23ai/oml4sql-time-series-esm-auto-model-search.sql b/machine-learning/sql/23ai/oml4sql-time-series-esm-auto-model-search.sql index 0000d9ba..bcfe20ca 100644 --- a/machine-learning/sql/23ai/oml4sql-time-series-esm-auto-model-search.sql +++ b/machine-learning/sql/23ai/oml4sql-time-series-esm-auto-model-search.sql @@ -78,13 +78,9 @@ ORDER BY setting_name; -- COMPUTED SETTINGS AND OTHER GLOBAL STATISTICS -- -SELECT TYPE, name, nval, sval -FROM DM$PPESM_SALES_FORECAST_1 -ORDER BY TYPE, name; - -SELECT global_detail_name, ROUND(global_detail_value,3) global_detail_value -FROM table(dbms_data_mining.get_model_details_global('ESM_SALES_FORECAST_1')) -ORDER BY global_detail_name; +SELECT name, ROUND(numeric_value,3) numeric_value, string_value +FROM DM$VGESM_SALES_FORECAST_1 +ORDER BY name; / ----------------------------------------------------------------------- From 0f33d8ab1e98092f45e5cfd0a6ba4283dc750292 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 08:58:38 -0700 Subject: [PATCH 02/37] Bump cookie and express (#398) Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `cookie` from 0.6.0 to 0.7.1 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1) Updates `express` from 4.19.2 to 4.21.1 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.1) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../hr_app_streaming/package-lock.json | 99 ++++++++++--------- .../hr_app_streaming/package.json | 2 +- 2 files changed, 53 insertions(+), 48 deletions(-) diff --git a/javascript/files-up-and-down/hr_app_streaming/package-lock.json b/javascript/files-up-and-down/hr_app_streaming/package-lock.json index af679121..e13a702d 100644 --- a/javascript/files-up-and-down/hr_app_streaming/package-lock.json +++ b/javascript/files-up-and-down/hr_app_streaming/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -98,9 +98,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookie-signature": { "version": "1.0.6", @@ -141,9 +141,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { "version": "1.0.0", @@ -169,36 +169,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -227,12 +227,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -354,9 +354,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -404,9 +404,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "on-finished": { "version": "2.3.0", @@ -432,9 +432,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "proxy-addr": { "version": "2.0.7", @@ -446,11 +446,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -480,9 +480,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -504,6 +504,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -520,14 +525,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { diff --git a/javascript/files-up-and-down/hr_app_streaming/package.json b/javascript/files-up-and-down/hr_app_streaming/package.json index 59db3e7b..eb964f2b 100644 --- a/javascript/files-up-and-down/hr_app_streaming/package.json +++ b/javascript/files-up-and-down/hr_app_streaming/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.1", "morgan": "^1.9.1", "oracledb": "^3.1.2" } From 1076df1456b88020b0fd0a68aa7aba3852cf1c5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 09:13:26 -0700 Subject: [PATCH 03/37] Bump cookie and express (#401) Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `cookie` from 0.6.0 to 0.7.1 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1) Updates `express` from 4.19.2 to 4.21.1 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.1) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../hr_app/package-lock.json | 99 ++++++++++--------- .../hr_app/package.json | 2 +- 2 files changed, 53 insertions(+), 48 deletions(-) diff --git a/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json b/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json index ac624da0..5b75f660 100644 --- a/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json +++ b/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -93,9 +93,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookie-signature": { "version": "1.0.6", @@ -136,9 +136,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { "version": "1.0.0", @@ -164,36 +164,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -217,12 +217,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -337,9 +337,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -394,9 +394,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "on-finished": { "version": "2.3.0", @@ -417,9 +417,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "proxy-addr": { "version": "2.0.7", @@ -431,11 +431,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -465,9 +465,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -484,6 +484,11 @@ "statuses": "2.0.1" }, "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -500,14 +505,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { diff --git a/javascript/rest-api/part-1-web-server-basics/hr_app/package.json b/javascript/rest-api/part-1-web-server-basics/hr_app/package.json index acc240c4..f53fc831 100644 --- a/javascript/rest-api/part-1-web-server-basics/hr_app/package.json +++ b/javascript/rest-api/part-1-web-server-basics/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.1", "morgan": "^1.9.1" } } From f3ba4cae75a24b98f18a95e3b1b526c862bbcd6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 09:15:16 -0700 Subject: [PATCH 04/37] Bump cookie and express (#400) Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `cookie` from 0.6.0 to 0.7.1 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1) Updates `express` from 4.19.2 to 4.21.1 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.1) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 99 ++++++++++--------- .../hr_app/package.json | 2 +- 2 files changed, 53 insertions(+), 48 deletions(-) diff --git a/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json b/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json index 221ccad5..00beabb2 100644 --- a/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json +++ b/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -93,9 +93,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookie-signature": { "version": "1.0.6", @@ -136,9 +136,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { "version": "1.0.0", @@ -164,36 +164,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -217,12 +217,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -337,9 +337,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -394,9 +394,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "on-finished": { "version": "2.3.0", @@ -422,9 +422,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "proxy-addr": { "version": "2.0.7", @@ -436,11 +436,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -470,9 +470,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -489,6 +489,11 @@ "statuses": "2.0.1" }, "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -505,14 +510,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { diff --git a/javascript/rest-api/part-2-database-basics/hr_app/package.json b/javascript/rest-api/part-2-database-basics/hr_app/package.json index 2761109c..5427eacf 100644 --- a/javascript/rest-api/part-2-database-basics/hr_app/package.json +++ b/javascript/rest-api/part-2-database-basics/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.1", "morgan": "^1.10.0", "oracledb": "^5.1.0" } From 6a72d46fea2c842d6711002acab706230b4117ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 09:18:09 -0700 Subject: [PATCH 05/37] Bump body-parser and express (#397) Bumps [body-parser](https://github.com/expressjs/body-parser) to 1.20.3 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `body-parser` from 1.20.2 to 1.20.3 - [Release notes](https://github.com/expressjs/body-parser/releases) - [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3) Updates `express` from 4.19.2 to 4.21.0 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0) --- updated-dependencies: - dependency-name: body-parser dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 91 ++++++++++--------- .../hr_app/package.json | 2 +- 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json index 221ccad5..3c1cde88 100644 --- a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json +++ b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -136,9 +136,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { "version": "1.0.0", @@ -164,36 +164,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -217,12 +217,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -337,9 +337,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -394,9 +394,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "on-finished": { "version": "2.3.0", @@ -422,9 +422,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "proxy-addr": { "version": "2.0.7", @@ -436,11 +436,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -470,9 +470,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -489,6 +489,11 @@ "statuses": "2.0.1" }, "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -505,14 +510,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { diff --git a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json index 2761109c..c81b3029 100644 --- a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json +++ b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.0", "morgan": "^1.10.0", "oracledb": "^5.1.0" } From 264ea1c770fd8711fb476383fd851dd07f631a79 Mon Sep 17 00:00:00 2001 From: Norman Aberin Date: Wed, 6 Nov 2024 11:16:55 -0600 Subject: [PATCH 06/37] Adds Basic/simplified Resource Provider Code sample (#404) * Added jdbc-resource-providers sample application * Added license * Update Main.java * Updated .properties file * Update README.md * Update Main.java --- java/jdbc-resource-providers/README.md | 141 ++++++++++++++++++ java/jdbc-resource-providers/pom.xml | 51 +++++++ .../properties/demo-1.properties | 54 +++++++ .../properties/demo-2.properties | 61 ++++++++ .../properties/demo-3.properties | 70 +++++++++ .../src/main/java/org/oracle/Main.java | 79 ++++++++++ .../main/resources/simplelogger.properties | 1 + 7 files changed, 457 insertions(+) create mode 100644 java/jdbc-resource-providers/README.md create mode 100644 java/jdbc-resource-providers/pom.xml create mode 100644 java/jdbc-resource-providers/properties/demo-1.properties create mode 100644 java/jdbc-resource-providers/properties/demo-2.properties create mode 100644 java/jdbc-resource-providers/properties/demo-3.properties create mode 100644 java/jdbc-resource-providers/src/main/java/org/oracle/Main.java create mode 100644 java/jdbc-resource-providers/src/main/resources/simplelogger.properties diff --git a/java/jdbc-resource-providers/README.md b/java/jdbc-resource-providers/README.md new file mode 100644 index 00000000..c3680560 --- /dev/null +++ b/java/jdbc-resource-providers/README.md @@ -0,0 +1,141 @@ +# Resource Providers Sample + +Simple Sample Application demonstrating use of Resource Providers. + +- __Oracle JDBC Version `ojdbc11-production` - `v23.5.0.24.07`__ +- __Java Version used `21`__ +- __Oracle Autonomous Database used `19c`__ + +## Environment Variables +The following environment variables are expected by the application. +In order to successfully run the application, the required environment variables below are marked and some are optional: + +| Variable | Required | Name | Default | Description | +|------------------------|:-----------:|--------------------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------| +| `ORACLE_PASSWORD` | Conditional | Database Password | - | Database Credential if required | +| `ORACLE_USERNAME` | Conditional | Database User | | Database Credentials if required, user must exist | +| `COMPARTMENT_OCID` | Conditional | Compartment OCID | | Compartment Oracle Cloud Identifier(OCID) in which the Oracle Database lives in, used by Access Token Provider in determining scope | +| `DATABASE_OCID` | Conditional | Database OCID | | Database Oracle Cloud Identifier(OCID), used by multiple providers | +| `KEY_VAULT_URL` | Conditional | Azure Key Vault URL | | Key Vault URL used by Azure Key Vault Providers | +| `USERNAME_SECRET_NAME` | Conditional | Azure Key Vault Username Secret Name | | Name of secret in Azure Key Vault used by the Azure Key Vault Username Providers | +| `PASSWORD_SECRET_NAME` | Conditional | Azure Key Vault Password Secret Name | | Name of secret in Azure Key Vault used by the Azure Key Vault Password Providers | + +### Demo Files +- [demo-1.properties](properties/demo-1.properties) - Property file for OCI Connection TLS + OCI Connection String Providers +- [demo-2.properties](properties/demo-2.properties) - Property file for OCI Connection TLS + OCI Connection String + OCI Access Token Providers +- [demo-3.properties](properties/demo-3.properties) - Property file for OCI Connection TLS + OCI Connection String + Azure Key Vault Username and Password Providers + + + + +# Building the Application +The application uses Maven to build and manage the project with its dependencies. +```bash +mvn clean package +``` + +# Running the Application +To run the application JAR, you can run the following commmand: +```bash +java -jar target/java-basic-1.0-SNAPSHOT.jar +``` + +# Running the Demos + +### Example 1: OCI Connection TLS + OCI Connection String Providers + +To run this example, in [main.java](src/main/java/org/oracle/Main.java), set the following environment variables +referenced in the following lines, as user credentials are required. +```java + String PASSWORD = System.getenv("ORACLE_PASSWORD"); + String USERNAME = System.getenv("ORACLE_USERNAME"); +``` +Make sure the User and Password are set: +```java +OracleDataSource ods = new OracleDataSource(); +ods.setURL("jdbc:oracle:thin:@"); +ods.setUser(USERNAME); +ods.setPassword(PASSWORD); +``` +Set the following system property to the demo-1.properties file. +```bash + System.setProperty("oracle.jdbc.config.file", "properties/demo-1.properties"); +``` + +This `.properties` file requires the environment variable: +- DATABASE_OCID + + +Refer to the following documentations in regard to authentication and further configurations: +1. [Configuring Authentication for Resource Providers](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#configuring-authentication-1) +2. [OCI Connection TLS Provider](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-tls-provider) +3. [OCI Connection String Provider](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-connection-string-provider) + +### Example 2: OCI Connection TLS + OCI Connection String + OCI Access Token Providers + +To run this example, in [main.java](src/main/java/org/oracle/Main.java), __remove__ or __comment out__ the following lines as user credentials are not required. +```java + String PASSWORD = System.getenv("ORACLE_PASSWORD"); + String USERNAME = System.getenv("ORACLE_USERNAME"); +``` + +Make sure the credentials are NOT set: +```java +OracleDataSource ods = new OracleDataSource(); +ods.setURL("jdbc:oracle:thin:@"); +``` + +Set the following system property to the demo-2.properties file. + +```bash + System.setProperty("oracle.jdbc.config.file", "properties/demo-2.properties"); +``` + +This `.properties` file requires the environment variable: +- DATABASE_OCID +- COMPARTMENT_OCID + + +Refer to the following documentations in regard to authentication and further configurations: +1. [Configuring Authentication for Resource Providers](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#configuring-authentication-1) +2. [OCI Access token Provider](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#access-token-provider) +3. [Authenticating into the Database using Oracle Cloud IAM and Access Tokens](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/manage-users-iam.html) + + + +### Example 3: OCI Connection TLS + OCI Connection String Providers + +To run this example, in [main.java](src/main/java/org/oracle/Main.java), __remove__ or __comment out__ the following lines as user credentials are not required. +```java + String PASSWORD = System.getenv("ORACLE_PASSWORD"); + String USERNAME = System.getenv("ORACLE_USERNAME"); +``` + +Make sure the credentials are NOT set: +```java +OracleDataSource ods = new OracleDataSource(); +ods.setURL("jdbc:oracle:thin:@"); +``` + +Set the following system property to the demo-3.properties file. + +```bash + System.setProperty("oracle.jdbc.config.file", "properties/demo-3.properties"); +``` + +This `.properties` file requires the environment variables: +- DATABASE_OCID +- KEY_VAULT_URL +- USERNAME_SECRET_NAME +- PASSWORD_SECRET_NAME + + +Refer to the following documentations in regard to authentication and further configurations: +1. [Configuring Authentication for Resource Providers](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#configuring-authentication-1) +2. [Azure Key Vault Username Provider](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-azure/README.md#key-vault-username-provider) +3. [Azure Key Vault Password Provider](https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-azure/README.md#key-vault-password-provider) + +# Documentation +- [GitHub: Oracle JDBC Extensions](https://github.com/oracle/ojdbc-extensions/tree/main) + + diff --git a/java/jdbc-resource-providers/pom.xml b/java/jdbc-resource-providers/pom.xml new file mode 100644 index 00000000..fe6b747a --- /dev/null +++ b/java/jdbc-resource-providers/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + + org.oracle + jdbc-resource-providers + 1.0-SNAPSHOT + + + 21 + 21 + UTF-8 + 2.0.16 + + + + + com.oracle.database.jdbc + ojdbc11-production + 23.5.0.24.07 + pom + + + + com.oracle.database.jdbc + ojdbc-provider-oci + 1.0.1 + + + + com.oracle.database.jdbc + ojdbc-provider-azure + 1.0.1 + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + slf4j-simple + ${slf4j.version} + + + + diff --git a/java/jdbc-resource-providers/properties/demo-1.properties b/java/jdbc-resource-providers/properties/demo-1.properties new file mode 100644 index 00000000..7a0f6ba4 --- /dev/null +++ b/java/jdbc-resource-providers/properties/demo-1.properties @@ -0,0 +1,54 @@ +################################################################################ +# Copyright (c) 2024 Oracle and/or its affiliates. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or data +# (collectively the "Software"), free of charge and under any and all copyright +# rights in the Software, and any and all patent rights owned or freely +# licensable by each licensor hereunder covering either (i) the unmodified +# Software as contributed to or provided by such licensor, or (ii) the Larger +# Works (as defined below), to deal in both +# +# (a) the Software, and +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software (each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# The above copyright notice and either this complete permission notice or at +# a minimum a reference to the UPL must be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +################################################################################ + + +# Configures the OCI Database Connection String Provider. The OCID of the database +# is configured as an environment variable or JVM system property named +# "DATABASE_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-connection-string-provider +oracle.jdbc.provider.connectionString=ojdbc-provider-oci-database-connection-string +oracle.jdbc.provider.connectionString.ocid=${DATABASE_OCID} +oracle.jdbc.provider.connectionString.profile=DEFAULT + +# Configures the OCI Database TLS Provider. Again, the OCID of the database +# is configured as an environment variable or JVM system property named +# "DATABASE_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-tls-provider +oracle.jdbc.provider.tlsConfiguration=ojdbc-provider-oci-database-tls +oracle.jdbc.provider.tlsConfiguration.ocid=${DATABASE_OCID} +oracle.jdbc.provider.tlsConfiguration.profile=DEFAULT diff --git a/java/jdbc-resource-providers/properties/demo-2.properties b/java/jdbc-resource-providers/properties/demo-2.properties new file mode 100644 index 00000000..4232bc0a --- /dev/null +++ b/java/jdbc-resource-providers/properties/demo-2.properties @@ -0,0 +1,61 @@ +################################################################################ +# Copyright (c) 2024 Oracle and/or its affiliates. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or data +# (collectively the "Software"), free of charge and under any and all copyright +# rights in the Software, and any and all patent rights owned or freely +# licensable by each licensor hereunder covering either (i) the unmodified +# Software as contributed to or provided by such licensor, or (ii) the Larger +# Works (as defined below), to deal in both +# +# (a) the Software, and +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software (each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# The above copyright notice and either this complete permission notice or at +# a minimum a reference to the UPL must be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +################################################################################ + +# Configures the OCI Database Connection String Provider. The OCID of the database +# is configured as an environment variable or JVM system property named +# "DATABASE_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-connection-string-provider +oracle.jdbc.provider.connectionString=ojdbc-provider-oci-database-connection-string +oracle.jdbc.provider.connectionString.ocid=${DATABASE_OCID} +oracle.jdbc.provider.connectionString.profile=DEFAULT + +# Configures the OCI Database TLS Provider. Again, the OCID of the database +# is configured as an environment variable or JVM system property named +# "DATABASE_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-tls-provider +oracle.jdbc.provider.tlsConfiguration=ojdbc-provider-oci-database-tls +oracle.jdbc.provider.tlsConfiguration.ocid=${DATABASE_OCID} +oracle.jdbc.provider.tlsConfiguration.profile=DEFAULT + +# Configures the OCI OAUTH Token Provider. The OCID of the database and its +# compartment are configured as an environment variables or JVM system +# properties named "DATABASE_OCID" and "COMPARTMENT_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#access-token-provider +oracle.jdbc.provider.accessToken=ojdbc-provider-oci-token +oracle.jdbc.provider.accessToken.scope=urn:oracle:db::id::${COMPARTMENT_OCID}::${DATABASE_OCID} +oracle.jdbc.provider.accessToken.profile=DEFAULT \ No newline at end of file diff --git a/java/jdbc-resource-providers/properties/demo-3.properties b/java/jdbc-resource-providers/properties/demo-3.properties new file mode 100644 index 00000000..3aab174d --- /dev/null +++ b/java/jdbc-resource-providers/properties/demo-3.properties @@ -0,0 +1,70 @@ +################################################################################ +# Copyright (c) 2024 Oracle and/or its affiliates. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or data +# (collectively the "Software"), free of charge and under any and all copyright +# rights in the Software, and any and all patent rights owned or freely +# licensable by each licensor hereunder covering either (i) the unmodified +# Software as contributed to or provided by such licensor, or (ii) the Larger +# Works (as defined below), to deal in both +# +# (a) the Software, and +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software (each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# The above copyright notice and either this complete permission notice or at +# a minimum a reference to the UPL must be included in all copies or +# substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +################################################################################ + +# Configures the OCI Database Connection String Provider. The OCID of the database +# is configured as an environment variable or JVM system property named +# "DATABASE_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-connection-string-provider +oracle.jdbc.provider.connectionString=ojdbc-provider-oci-database-connection-string +oracle.jdbc.provider.connectionString.ocid=${DATABASE_OCID} +oracle.jdbc.provider.connectionString.profile=DEFAULT + +# Configures the OCI Database TLS Provider. Again, the OCID of the database +# is configured as an environment variable or JVM system property named +# "DATABASE_OCID": +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-oci/README.md#database-tls-provider +oracle.jdbc.provider.tlsConfiguration=ojdbc-provider-oci-database-tls +oracle.jdbc.provider.tlsConfiguration.ocid=${DATABASE_OCID} +oracle.jdbc.provider.tlsConfiguration.profile=DEFAULT + +# Configures the Azure Key Vault Username Provider. The vault URL and secret name +# are configured as an environment variables or JVM system properties +# named "KEY_VAULT_URL" and "USERNAME_SECRET_NAME". +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-azure/README.md#key-vault-username-provider +oracle.jdbc.provider.username=ojdbc-provider-azure-key-vault-username +oracle.jdbc.provider.username.vaultUrl=${KEY_VAULT_URL} +oracle.jdbc.provider.username.secretName=${USERNAME_SECRET_NAME} + +# Configures the Azure Key Vault Password Provider. The vault URL and secret name +# are configured as an environment variables or JVM system properties +# named "KEY_VAULT_URL" and "PASSWORD_SECRET_NAME". +# https://github.com/oracle/ojdbc-extensions/blob/main/ojdbc-provider-azure/README.md#key-vault-password-provider +oracle.jdbc.provider.password=ojdbc-provider-azure-key-vault-password +oracle.jdbc.provider.password.vaultUrl=${KEY_VAULT_URL} +oracle.jdbc.provider.password.secretName=${PASSWORD_SECRET_NAME} + diff --git a/java/jdbc-resource-providers/src/main/java/org/oracle/Main.java b/java/jdbc-resource-providers/src/main/java/org/oracle/Main.java new file mode 100644 index 00000000..1ef5c4aa --- /dev/null +++ b/java/jdbc-resource-providers/src/main/java/org/oracle/Main.java @@ -0,0 +1,79 @@ +/* + ** Copyright (c) 2024 Oracle and/or its affiliates. + ** + ** The Universal Permissive License (UPL), Version 1.0 + ** + ** Subject to the condition set forth below, permission is hereby granted to any + ** person obtaining a copy of this software, associated documentation and/or data + ** (collectively the "Software"), free of charge and under any and all copyright + ** rights in the Software, and any and all patent rights owned or freely + ** licensable by each licensor hereunder covering either (i) the unmodified + ** Software as contributed to or provided by such licensor, or (ii) the Larger + ** Works (as defined below), to deal in both + ** + ** (a) the Software, and + ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if + ** one is included with the Software (each a "Larger Work" to which the Software + ** is contributed by such licensors), + ** + ** without restriction, including without limitation the rights to copy, create + ** derivative works of, display, perform, and distribute the Software and make, + ** use, sell, offer for sale, import, export, have made, and have sold the + ** Software and the Larger Work(s), and to sublicense the foregoing rights on + ** either these or other terms. + ** + ** This license is subject to the following condition: + ** The above copyright notice and either this complete permission notice or at + ** a minimum a reference to the UPL must be included in all copies or + ** substantial portions of the Software. + ** + ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + ** SOFTWARE. + */ + +package org.oracle; + +import oracle.jdbc.pool.OracleDataSource; + +import java.sql.SQLException; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Connection; + + +public class Main { + public static void main(String[] args) throws SQLException { + + // Retrieve credentials, if needed + // comment out if username, password not required + String PASSWORD = System.getenv("ORACLE_PASSWORD"); + String USERNAME = System.getenv("ORACLE_USERNAME"); + // Set custom location for the config properties file with the property oracle.jdbc.config.file + System.setProperty("oracle.jdbc.config.file", "properties/demo-1.properties"); + + // Configure OracleDataSource + OracleDataSource ods = new OracleDataSource(); + ods.setURL("jdbc:oracle:thin:@"); + // comment out if username, password not required + ods.setUser(USERNAME); + ods.setPassword(PASSWORD); + + // try-with: establish a connection and retrieve database version + try (Connection connection = ods.getConnection(); + PreparedStatement ps = connection.prepareStatement("select BANNER from v$version"); + ResultSet rs = ps.executeQuery() + ) { + rs.next(); + System.out.println(rs.getString("BANNER")); + + } catch (SQLException e) { + throw new RuntimeException(e); + } + + } +} \ No newline at end of file diff --git a/java/jdbc-resource-providers/src/main/resources/simplelogger.properties b/java/jdbc-resource-providers/src/main/resources/simplelogger.properties new file mode 100644 index 00000000..9a9b2a0f --- /dev/null +++ b/java/jdbc-resource-providers/src/main/resources/simplelogger.properties @@ -0,0 +1 @@ +org.slf4j.simpleLogger.defaultLogLevel = error \ No newline at end of file From c3bd7715eac574edc6266049402effff414f7c91 Mon Sep 17 00:00:00 2001 From: Juarez Barbosa Junior Date: Tue, 19 Nov 2024 08:26:49 +0000 Subject: [PATCH 07/37] Code sample - 23c SpringBoot JPA Hibernate UCP (#315) * Code sample - 23c SpringBoot JPA Hibernate UCP * code sample adjustments * code sample adjustments * fixed indentation * adjusted to 23ai as requested * adjusted to the latest driver version (Nov 24) 23.6.0.24.10 as requested --- java/23ai-springboot3-jpa-ucp/.gitignore | 178 ++++++++++++++++++ java/23ai-springboot3-jpa-ucp/README.md | 2 + java/23ai-springboot3-jpa-ucp/pom.xml | 90 +++++++++ .../23c-SpringBoot-JPA_Hibernate-UCP.sql | 30 +++ .../jdbc/springboot3/jpa/ucp/Employee.java | 118 ++++++++++++ .../jpa/ucp/EmployeeApplication.java | 34 ++++ .../jpa/ucp/EmployeeController.java | 78 ++++++++ .../jpa/ucp/EmployeeNotFoundAdvice.java | 39 ++++ .../jpa/ucp/EmployeeNotFoundException.java | 31 +++ .../jpa/ucp/EmployeeRepository.java | 28 +++ .../src/main/resources/application.properties | 22 +++ 11 files changed, 650 insertions(+) create mode 100644 java/23ai-springboot3-jpa-ucp/.gitignore create mode 100644 java/23ai-springboot3-jpa-ucp/README.md create mode 100644 java/23ai-springboot3-jpa-ucp/pom.xml create mode 100644 java/23ai-springboot3-jpa-ucp/script/23c-SpringBoot-JPA_Hibernate-UCP.sql create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/Employee.java create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeApplication.java create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeController.java create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundAdvice.java create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundException.java create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeRepository.java create mode 100644 java/23ai-springboot3-jpa-ucp/src/main/resources/application.properties diff --git a/java/23ai-springboot3-jpa-ucp/.gitignore b/java/23ai-springboot3-jpa-ucp/.gitignore new file mode 100644 index 00000000..826d607c --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/.gitignore @@ -0,0 +1,178 @@ +# Java related +target/ +*.jar +*.war +*.ear +*.class + +# Log file +*.log + +# Package Files +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# JVM crash logs - http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Eclipse.gitignore - https://github.com/github/gitignore/blob/main/Global/Eclipse.gitignore +.metadata +.classpath +.project +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# CDT- autotools +.autotools + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Annotation Processing +.apt_generated/ +.apt_generated_test/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet + +# Uncomment this line if you wish to ignore the project description file. +# Typically, this file would be tracked if it contains build/dependency configurations: +#.project + +# External tool builders +.externalToolBuilders/ + +# VS Code - https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +# JetBrains .gitignore - https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser diff --git a/java/23ai-springboot3-jpa-ucp/README.md b/java/23ai-springboot3-jpa-ucp/README.md new file mode 100644 index 00000000..58a8a180 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/README.md @@ -0,0 +1,2 @@ +# 23c-springboot3-jpa-ucp +[Java Persistence with Spring Boot 3, Spring Data JPA with Hibernate, and the Oracle Database 23c Free - Developer Release](https://rb.gy/i54khj) diff --git a/java/23ai-springboot3-jpa-ucp/pom.xml b/java/23ai-springboot3-jpa-ucp/pom.xml new file mode 100644 index 00000000..e80cd1e2 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/pom.xml @@ -0,0 +1,90 @@ + + + + 4.0.0 + + + org.springframework.boot + spring-boot-starter-parent + 3.3.0 + + + + com.oracle.dev.jdbc + 23ai-springboot3-jpa-ucp + 1.0-SNAPSHOT + 23ai-springboot3-jpa-ucp + Java Persistence with Spring Boot 3, Spring Data JPA with + Hibernate, and the Oracle Database 23ai Free + + https://juarezjunior.medium.com/java-persistence-with-spring-boot-3-spring-data-jpa-with-hibernate-and-the-oracle-database-23c-9c0946d4838f + + 21 + UTF-8 + 21 + 21 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + com.oracle.database.jdbc + ojdbc11-production + 23.6.0.24.10 + pom + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + + + org.hibernate.orm.tooling + hibernate-enhance-maven-plugin + ${hibernate.version} + + + enhance + + enhance + + + true + true + true + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + maven-compiler-plugin + + + + + + + + diff --git a/java/23ai-springboot3-jpa-ucp/script/23c-SpringBoot-JPA_Hibernate-UCP.sql b/java/23ai-springboot3-jpa-ucp/script/23c-SpringBoot-JPA_Hibernate-UCP.sql new file mode 100644 index 00000000..3696f6b5 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/script/23c-SpringBoot-JPA_Hibernate-UCP.sql @@ -0,0 +1,30 @@ +CREATE USER ORACLE_23C_USER IDENTIFIED BY ; +GRANT DB_DEVELOPER_ROLE TO ORACLE_23C_USER; +GRANT CREATE SESSION TO ORACLE_23C_USER; +GRANT UNLIMITED TABLESPACE TO ORACLE_23C_USER; + +CREATE TABLE Employee + (id NUMBER(10) CONSTRAINT pk_employee PRIMARY KEY, + name VARCHAR2(20), + job VARCHAR2(20), + salary NUMBER(10), + commission NUMBER(10)); + +INSERT INTO Employee VALUES(7369,'JOHN','CLERK',7902,NULL); +INSERT INTO Employee VALUES(7499,'PETER','SALESMAN',7698,300); +INSERT INTO Employee VALUES(7521,'JEFF','SALESMAN',7698,500); +INSERT INTO Employee VALUES(7566,'MARK','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7654,'MARTIN','SALESMAN',7698,1400); +INSERT INTO Employee VALUES(7698,'ADAM','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7782,'CLARK','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7788,'SCOTT','ANALYST',7566,NULL); +INSERT INTO Employee VALUES(7839,'KING','PRESIDENT',NULL); +INSERT INTO Employee VALUES(7844,'TURNER','SALESMAN',0); +INSERT INTO Employee VALUES(7876,'ADAMS','CLERK',7788,NULL); +INSERT INTO Employee VALUES(7900,'JAMES','CLERK',7698,NULL); +INSERT INTO Employee VALUES(7902,'FORD','ANALYST',7566,NULL); +INSERT INTO Employee VALUES(7934,'MILLER','CLERK',7782,NULL); + +COMMIT; + +SELECT * FROM EMPLOYEE; \ No newline at end of file diff --git a/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/Employee.java b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/Employee.java new file mode 100644 index 00000000..afe5b94f --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/Employee.java @@ -0,0 +1,118 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.springboot3.jpa.ucp; + +import java.util.Objects; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +@Entity +@Table(name = "EMPLOYEE", schema = "SYSTEM") +public class Employee { + + private @Id @GeneratedValue Long id; + private String name; + private String job; + private Integer salary; + private Integer commission; + + public Employee() { + } + + public Employee(Long id, String name, String job, Integer salary, + Integer commission) { + this.id = id; + this.name = name; + this.job = job; + this.salary = salary; + this.commission = commission; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + + public Integer getSalary() { + return salary; + } + + public void setSalary(Integer salary) { + this.salary = salary; + } + + public Integer getCommission() { + return commission; + } + + public void setCommission(Integer commission) { + this.commission = commission; + } + + @Override + public int hashCode() { + return Objects.hash(commission, id, job, name, salary); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Employee other = (Employee) obj; + return Objects.equals(commission, other.commission) + && Objects.equals(id, other.id) && Objects.equals(job, other.job) + && Objects.equals(name, other.name) + && Objects.equals(salary, other.salary); + } + + public String toString() { + return String.format("%20s %20s %20s %20s %20s", id, name, job, salary, + commission); + + } +} diff --git a/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeApplication.java b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeApplication.java new file mode 100644 index 00000000..e4ee5f42 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeApplication.java @@ -0,0 +1,34 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.springboot3.jpa.ucp; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class EmployeeApplication { + + public static void main(String[] args) { + SpringApplication.run(EmployeeApplication.class, args); + } + +} diff --git a/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeController.java b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeController.java new file mode 100644 index 00000000..7a9fa625 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeController.java @@ -0,0 +1,78 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.springboot3.jpa.ucp; + +import java.util.List; + +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + @GetMapping("/employees") + List all() { + return repository.findAll(); + } + + @PostMapping("/employees") + Employee newEmployee(@RequestBody Employee newEmployee) { + return repository.save(newEmployee); + } + + @GetMapping("/employees/{id}") + Employee one(@PathVariable Long id) { + + return repository.findById(id) + .orElseThrow(() -> new EmployeeNotFoundException(id)); + } + + @PutMapping("/employees/{id}") + Employee replaceEmployee(@RequestBody Employee newEmployee, + @PathVariable Long id) { + + return repository.findById(id).map(employee -> { + employee.setName(newEmployee.getName()); + employee.setJob(newEmployee.getJob()); + return repository.save(employee); + }).orElseGet(() -> { + newEmployee.setId(id); + return repository.save(newEmployee); + }); + } + + @DeleteMapping("/employees/{id}") + void deleteEmployee(@PathVariable Long id) { + repository.deleteById(id); + } +} \ No newline at end of file diff --git a/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundAdvice.java b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundAdvice.java new file mode 100644 index 00000000..a6eda8bf --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundAdvice.java @@ -0,0 +1,39 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.springboot3.jpa.ucp; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ControllerAdvice +class EmployeeNotFoundAdvice { + + @ResponseBody + @ExceptionHandler(EmployeeNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + String employeeNotFoundHandler(EmployeeNotFoundException ex) { + return ex.getMessage(); + } +} \ No newline at end of file diff --git a/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundException.java b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundException.java new file mode 100644 index 00000000..d8593dad --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeNotFoundException.java @@ -0,0 +1,31 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.springboot3.jpa.ucp; + +class EmployeeNotFoundException extends RuntimeException { + + private static final long serialVersionUID = 7768215094663842819L; + + EmployeeNotFoundException(Long id) { + super("Could not find employee " + id); + } +} \ No newline at end of file diff --git a/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeRepository.java b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeRepository.java new file mode 100644 index 00000000..25e08986 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/java/com/oracle/dev/jdbc/springboot3/jpa/ucp/EmployeeRepository.java @@ -0,0 +1,28 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.springboot3.jpa.ucp; + +import org.springframework.data.jpa.repository.JpaRepository; + +interface EmployeeRepository extends JpaRepository { + +} \ No newline at end of file diff --git a/java/23ai-springboot3-jpa-ucp/src/main/resources/application.properties b/java/23ai-springboot3-jpa-ucp/src/main/resources/application.properties new file mode 100644 index 00000000..dc341448 --- /dev/null +++ b/java/23ai-springboot3-jpa-ucp/src/main/resources/application.properties @@ -0,0 +1,22 @@ +# https://www.oracle.com/database/technologies/getting-started-using-jdbc.html + +# LOCAL 23c Free connection +spring.datasource.url=jdbc:oracle:thin@[hostname]:[port]/[DB service/name +spring.datasource.username= +spring.datasource.password= + +# Properties for UCP - Universal Connection Pool (UCP). Spring Boot 2.4.0 or above is required +spring.datasource.type=oracle.ucp.jdbc.PoolDataSource +spring.datasource.oracleucp.connection-pool-name=connectionPoolName1 +spring.datasource.oracleucp.initial-pool-size=1 +spring.datasource.oracleucp.min-pool-size=1 +spring.datasource.oracleucp.max-pool-size=2 +spring.datasource.oracleucp.connection-factory-class-name=oracle.jdbc.pool.OracleDataSource + +# Enable JPA / Hibernate debugging +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.format_sql=true +logging.level.org.hibernate.SQL=DEBUG +logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE + +spring.jpa.database-platform=org.hibernate.dialect.OracleDialect From 73628a20504c6eb9a54227afbea05120b6fb4150 Mon Sep 17 00:00:00 2001 From: Juarez Barbosa Junior Date: Sat, 23 Nov 2024 17:24:53 +0000 Subject: [PATCH 08/37] Added sample code - ODSA for Java Devs - Spring Boot 3 + Data JPA P2 (#229) * Added sample code - ODSA for Java Devs - Spring Boot 3 + Data JPA P2 * adjusted the number of initial connections * code sample adjustments * code sample adjustments * fix indentation * adjustment accepted, debugging properties removed * change year to 2024 + remove serial id attribute * update jdbc driver version to 23.6.0.24.10, address target dir * full technical explanation of topics --------- Co-authored-by: Jean de Lavarene --- java/odsa-spring/README.md | 2 + java/odsa-spring/pom.xml | 110 ++++++++++++++++ java/odsa-spring/script/ODSASpringBoot.sql | 31 +++++ .../oracle/dev/jdbc/odsa/spring/Employee.java | 118 ++++++++++++++++++ .../jdbc/odsa/spring/EmployeeApplication.java | 34 +++++ .../jdbc/odsa/spring/EmployeeController.java | 83 ++++++++++++ .../odsa/spring/EmployeeNotFoundAdvice.java | 39 ++++++ .../spring/EmployeeNotFoundException.java | 29 +++++ .../jdbc/odsa/spring/EmployeeRepository.java | 28 +++++ .../src/main/resources/application.properties | 15 +++ 10 files changed, 489 insertions(+) create mode 100644 java/odsa-spring/README.md create mode 100644 java/odsa-spring/pom.xml create mode 100644 java/odsa-spring/script/ODSASpringBoot.sql create mode 100644 java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/Employee.java create mode 100644 java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeApplication.java create mode 100644 java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeController.java create mode 100644 java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundAdvice.java create mode 100644 java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundException.java create mode 100644 java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeRepository.java create mode 100644 java/odsa-spring/src/main/resources/application.properties diff --git a/java/odsa-spring/README.md b/java/odsa-spring/README.md new file mode 100644 index 00000000..bd0f6b3d --- /dev/null +++ b/java/odsa-spring/README.md @@ -0,0 +1,2 @@ +# odsa-spring +[ODSA for Java Developers (Part 2) — Connecting to Oracle ADB from a Spring Boot 3 App with Spring Data JPA on Azure App Service](https://medium.com/oracledevs/odsa-for-java-developers-part-2-connecting-to-oracle-adb-from-a-spring-boot-3-0-b1ebb6296abc) diff --git a/java/odsa-spring/pom.xml b/java/odsa-spring/pom.xml new file mode 100644 index 00000000..14c02241 --- /dev/null +++ b/java/odsa-spring/pom.xml @@ -0,0 +1,110 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.0 + + + com.oracle.dev.jdbc + odsa-spring + 0.0.1-SNAPSHOT + odsa-spring + ODSA for Java Developers - Connecting to Oracle ADB from a Spring + Boot App on Azure + + 21 + + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + com.oracle.database.jdbc + ojdbc11-production + 23.6.0.24.10 + pom + + + + + + + org.hibernate.orm.tooling + hibernate-enhance-maven-plugin + ${hibernate.version} + + + enhance + + enhance + + + true + true + true + + + + + + org.graalvm.buildtools + native-maven-plugin + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + com.microsoft.azure + azure-webapp-maven-plugin + 2.5.0 + + YOUR_AZURE_SUBSCRIPTION_ID + DBIntegration.Multicloud.ResourceGroup + odsa-spring + B2 + westus + + Linux + Java SE + Java 17 + + + + + jar + ${project.basedir}/target + + *.jar + + + + + + + + + + + diff --git a/java/odsa-spring/script/ODSASpringBoot.sql b/java/odsa-spring/script/ODSASpringBoot.sql new file mode 100644 index 00000000..bdb25e23 --- /dev/null +++ b/java/odsa-spring/script/ODSASpringBoot.sql @@ -0,0 +1,31 @@ +CREATE USER ODSA_USER IDENTIFIED BY ; +ALTER USER ODSA_USER QUOTA 128M ON USERS; +ALTER SESSION SET CURRENT_SCHEMA = ODSA_USER; + +CREATE TABLE Employee + (id NUMBER(10) CONSTRAINT pk_employee PRIMARY KEY, + name VARCHAR2(20), + job VARCHAR2(20), + salary NUMBER(10), + commission NUMBER(10)); + +INSERT INTO Employee VALUES(7369,'JOHN','CLERK',7902,NULL); +INSERT INTO Employee VALUES(7499,'PETER','SALESMAN',7698,300); +INSERT INTO Employee VALUES(7521,'JEFF','SALESMAN',7698,500); +INSERT INTO Employee VALUES(7566,'MARK','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7654,'MARTIN','SALESMAN',7698,1400); +INSERT INTO Employee VALUES(7698,'ADAM','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7782,'CLARK','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7788,'SCOTT','ANALYST',7566,NULL); +INSERT INTO Employee VALUES(7839,'KING','PRESIDENT',NULL); +INSERT INTO Employee VALUES(7844,'TURNER','SALESMAN',0); +INSERT INTO Employee VALUES(7876,'ADAMS','CLERK',7788,NULL); +INSERT INTO Employee VALUES(7900,'JAMES','CLERK',7698,NULL); +INSERT INTO Employee VALUES(7902,'FORD','ANALYST',7566,NULL); +INSERT INTO Employee VALUES(7934,'MILLER','CLERK',7782,NULL); + +COMMIT; + + + + diff --git a/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/Employee.java b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/Employee.java new file mode 100644 index 00000000..566f2cd1 --- /dev/null +++ b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/Employee.java @@ -0,0 +1,118 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.odsa.spring; + +import java.util.Objects; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; + +@Entity +@Table(name = "EMPLOYEE", schema = "") +public class Employee { + + private @Id @GeneratedValue Long id; + private String name; + private String job; + private Integer salary; + private Integer commission; + + public Employee() { + } + + public Employee(Long id, String name, String job, Integer salary, + Integer commission) { + this.id = id; + this.name = name; + this.job = job; + this.salary = salary; + this.commission = commission; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + + public Integer getSalary() { + return salary; + } + + public void setSalary(Integer salary) { + this.salary = salary; + } + + public Integer getCommission() { + return commission; + } + + public void setCommission(Integer commission) { + this.commission = commission; + } + + @Override + public int hashCode() { + return Objects.hash(commission, id, job, name, salary); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Employee other = (Employee) obj; + return Objects.equals(commission, other.commission) + && Objects.equals(id, other.id) && Objects.equals(job, other.job) + && Objects.equals(name, other.name) + && Objects.equals(salary, other.salary); + } + + public String toString() { + return String.format("%20s %20s %20s %20s %20s", id, name, job, salary, + commission); + + } +} diff --git a/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeApplication.java b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeApplication.java new file mode 100644 index 00000000..582a9641 --- /dev/null +++ b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeApplication.java @@ -0,0 +1,34 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.odsa.spring; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class EmployeeApplication { + + public static void main(String[] args) { + SpringApplication.run(EmployeeApplication.class, args); + } + +} diff --git a/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeController.java b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeController.java new file mode 100644 index 00000000..53467193 --- /dev/null +++ b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeController.java @@ -0,0 +1,83 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.odsa.spring; + +import java.util.List; + +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + // Aggregate root + // tag::get-aggregate-root[] + @GetMapping("/employees") + List all() { + return repository.findAll(); + } + // end::get-aggregate-root[] + + @PostMapping("/employees") + Employee newEmployee(@RequestBody Employee newEmployee) { + return repository.save(newEmployee); + } + + // Single item + + @GetMapping("/employees/{id}") + Employee one(@PathVariable Long id) { + + return repository.findById(id) + .orElseThrow(() -> new EmployeeNotFoundException(id)); + } + + @PutMapping("/employees/{id}") + Employee replaceEmployee(@RequestBody Employee newEmployee, + @PathVariable Long id) { + + return repository.findById(id).map(employee -> { + employee.setName(newEmployee.getName()); + employee.setJob(newEmployee.getJob()); + return repository.save(employee); + }).orElseGet(() -> { + newEmployee.setId(id); + return repository.save(newEmployee); + }); + } + + @DeleteMapping("/employees/{id}") + void deleteEmployee(@PathVariable Long id) { + repository.deleteById(id); + } +} \ No newline at end of file diff --git a/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundAdvice.java b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundAdvice.java new file mode 100644 index 00000000..2cad8bf6 --- /dev/null +++ b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundAdvice.java @@ -0,0 +1,39 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.odsa.spring; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ControllerAdvice +class EmployeeNotFoundAdvice { + + @ResponseBody + @ExceptionHandler(EmployeeNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + String employeeNotFoundHandler(EmployeeNotFoundException ex) { + return ex.getMessage(); + } +} \ No newline at end of file diff --git a/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundException.java b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundException.java new file mode 100644 index 00000000..40c460ae --- /dev/null +++ b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeNotFoundException.java @@ -0,0 +1,29 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.odsa.spring; + +class EmployeeNotFoundException extends RuntimeException { + + EmployeeNotFoundException(Long id) { + super("Could not find employee " + id); + } +} \ No newline at end of file diff --git a/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeRepository.java b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeRepository.java new file mode 100644 index 00000000..14577ddd --- /dev/null +++ b/java/odsa-spring/src/main/java/com/oracle/dev/jdbc/odsa/spring/EmployeeRepository.java @@ -0,0 +1,28 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.jdbc.odsa.spring; + +import org.springframework.data.jpa.repository.JpaRepository; + +interface EmployeeRepository extends JpaRepository { + +} \ No newline at end of file diff --git a/java/odsa-spring/src/main/resources/application.properties b/java/odsa-spring/src/main/resources/application.properties new file mode 100644 index 00000000..f02fa9f4 --- /dev/null +++ b/java/odsa-spring/src/main/resources/application.properties @@ -0,0 +1,15 @@ +# https://www.oracle.com/database/technologies/getting-started-using-jdbc.html +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= + +# Properties for UCP - Universal Connection Pool (UCP). Spring Boot 2.4.0 or above is required +spring.datasource.driver-class-name=oracle.jdbc.OracleDriver +spring.datasource.type=oracle.ucp.jdbc.PoolDataSource +spring.datasource.oracleucp.connection-pool-name=connectionPoolName1 +spring.datasource.oracleucp.initial-pool-size=1 +spring.datasource.oracleucp.min-pool-size=1 +spring.datasource.oracleucp.max-pool-size=2 +spring.datasource.oracleucp.connection-factory-class-name=oracle.jdbc.pool.OracleDataSource + +spring.jpa.database-platform=org.hibernate.dialect.OracleDialect From 29f98121b8690711ccd42ff3bf4bdf391cec456e Mon Sep 17 00:00:00 2001 From: Radovan Radic Date: Wed, 4 Dec 2024 22:34:12 +0100 Subject: [PATCH 09/37] Upgrade micronaut dependencies containing improvement for Json Duality View (#407) Co-authored-by: Gerald Venzl --- java/micronaut-jsonview-demo-app/build.gradle | 4 ++-- java/micronaut-jsonview-demo-app/gradle.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/micronaut-jsonview-demo-app/build.gradle b/java/micronaut-jsonview-demo-app/build.gradle index 42317a77..7f129536 100644 --- a/java/micronaut-jsonview-demo-app/build.gradle +++ b/java/micronaut-jsonview-demo-app/build.gradle @@ -1,7 +1,7 @@ plugins { id "com.github.johnrengelman.shadow" version "8.1.1" - id "io.micronaut.application" version "4.4.0" - id "io.micronaut.test-resources" version "4.4.0" + id "io.micronaut.application" version "4.4.4" + id "io.micronaut.test-resources" version "4.4.4" } version = "0.1" diff --git a/java/micronaut-jsonview-demo-app/gradle.properties b/java/micronaut-jsonview-demo-app/gradle.properties index 1918e8f2..3b4d046e 100644 --- a/java/micronaut-jsonview-demo-app/gradle.properties +++ b/java/micronaut-jsonview-demo-app/gradle.properties @@ -1 +1 @@ -micronautVersion=4.5.0 \ No newline at end of file +micronautVersion=4.7.0 \ No newline at end of file From 1575e1e0564e3c05921d5469ddad6ebba93b2c61 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 5 Dec 2024 11:14:36 +1100 Subject: [PATCH 10/37] Update python-oracledb examples (#409) Signed-off-by: Christopher Jones Co-authored-by: Gerald Venzl --- python/python-oracledb/README.md | 4 +- python/python-oracledb/app_context.py | 7 +- python/python-oracledb/array_dml_rowcounts.py | 3 +- .../array_dml_rowcounts_async.py | 3 +- python/python-oracledb/async_gather.py | 3 +- python/python-oracledb/batch_errors.py | 3 +- python/python-oracledb/batch_errors_async.py | 3 +- python/python-oracledb/bind_insert.py | 3 +- python/python-oracledb/bind_insert_async.py | 3 +- python/python-oracledb/bind_query.py | 3 +- python/python-oracledb/bind_query_async.py | 3 +- python/python-oracledb/call_timeout.py | 3 +- python/python-oracledb/call_timeout_async.py | 3 +- python/python-oracledb/connection_pool.py | 3 +- python/python-oracledb/create_schema.py | 4 +- python/python-oracledb/dbms_output.py | 3 +- python/python-oracledb/dbms_output_async.py | 3 +- .../dml_returning_multiple_rows.py | 3 +- .../dml_returning_multiple_rows_async.py | 3 +- python/python-oracledb/drcp_pool.py | 3 +- python/python-oracledb/editioning.py | 7 +- python/python-oracledb/generic_row_factory.py | 3 +- .../generic_row_factory_async.py | 3 +- python/python-oracledb/implicit_results.py | 3 +- .../python-oracledb/implicit_results_async.py | 3 +- python/python-oracledb/insert_geometry.py | 3 +- .../python-oracledb/insert_geometry_async.py | 3 +- python/python-oracledb/json_blob.py | 3 +- python/python-oracledb/json_blob_async.py | 3 +- python/python-oracledb/json_direct.py | 3 +- python/python-oracledb/json_direct_async.py | 3 +- python/python-oracledb/json_duality.py | 1 + python/python-oracledb/json_duality_async.py | 1 + python/python-oracledb/last_rowid.py | 3 +- python/python-oracledb/last_rowid_async.py | 3 +- python/python-oracledb/load_csv.py | 3 +- python/python-oracledb/load_csv_async.py | 3 +- .../1-Connection.ipynb | 0 .../2-Queries.ipynb | 0 .../3-DML.ipynb | 0 .../4-CSV.ipynb | 0 .../5-JSON.ipynb | 0 .../6-PLSQL.ipynb | 0 .../7-Objects.ipynb | 0 .../{sample_notebooks => notebooks}/README.md | 2 +- .../csv/data1.csv | 0 .../images/architecture-thin.png | Bin .../images/banner.png | Bin .../images/drcp-architecture.png | Bin .../images/drcp-comparison.png | Bin .../images/jupyter-notebook-screenshot.png | Bin .../images/lob-benchmark.png | Bin .../images/pooled-connection.png | Bin .../images/roundtrip.png | Bin .../images/standalone-connection.png | Bin python/python-oracledb/object_dump.py | 3 +- python/python-oracledb/object_dump_async.py | 3 +- python/python-oracledb/pipelining_basic.py | 92 +++++++++++++++ python/python-oracledb/pipelining_error.py | 106 ++++++++++++++++++ python/python-oracledb/pipelining_parallel.py | 79 +++++++++++++ python/python-oracledb/plsql_collection.py | 3 +- .../python-oracledb/plsql_collection_async.py | 3 +- python/python-oracledb/plsql_function.py | 3 +- .../python-oracledb/plsql_function_async.py | 3 +- python/python-oracledb/plsql_procedure.py | 3 +- .../python-oracledb/plsql_procedure_async.py | 3 +- python/python-oracledb/plsql_record.py | 3 +- python/python-oracledb/plsql_record_async.py | 3 +- python/python-oracledb/plsql_rowtype.py | 1 + python/python-oracledb/plsql_rowtype_async.py | 1 + python/python-oracledb/query.py | 3 +- python/python-oracledb/query_arraysize.py | 3 +- .../python-oracledb/query_arraysize_async.py | 3 +- python/python-oracledb/query_async.py | 3 +- .../python-oracledb/query_strings_as_bytes.py | 3 +- .../query_strings_as_bytes_async.py | 3 +- python/python-oracledb/ref_cursor.py | 3 +- python/python-oracledb/ref_cursor_async.py | 3 +- .../python-oracledb/return_lobs_as_strings.py | 3 +- .../return_lobs_as_strings_async.py | 3 +- .../return_numbers_as_decimals.py | 3 +- .../return_numbers_as_decimals_async.py | 3 +- python/python-oracledb/rows_as_instance.py | 3 +- .../python-oracledb/rows_as_instance_async.py | 3 +- .../sample_container/Dockerfile | 2 +- python/python-oracledb/sample_env.py | 31 ++++- python/python-oracledb/session_callback.py | 3 +- python/python-oracledb/soda_json_duality.py | 2 +- .../python-oracledb/spatial_to_geopandas.py | 3 +- .../python-oracledb/sql/create_schema_23.sql | 39 +++---- python/python-oracledb/subclassing.py | 3 +- python/python-oracledb/subclassing_async.py | 3 +- .../type_handlers_json_strings.py | 3 +- .../type_handlers_json_strings_async.py | 3 +- .../python-oracledb/type_handlers_objects.py | 3 +- .../type_handlers_objects_async.py | 3 +- python/python-oracledb/universal_rowids.py | 3 +- .../python-oracledb/universal_rowids_async.py | 3 +- python/python-oracledb/vector.py | 28 +++-- python/python-oracledb/vector_async.py | 37 ++++-- python/python-oracledb/vector_numpy.py | 37 +++--- python/python-oracledb/vector_numpy_async.py | 29 +++-- python/python-oracledb/vector_string.py | 25 +++-- python/python-oracledb/write_csv.py | 1 + python/python-oracledb/write_csv_async.py | 1 + 105 files changed, 568 insertions(+), 164 deletions(-) rename python/python-oracledb/{sample_notebooks => notebooks}/1-Connection.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/2-Queries.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/3-DML.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/4-CSV.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/5-JSON.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/6-PLSQL.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/7-Objects.ipynb (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/README.md (98%) rename python/python-oracledb/{sample_notebooks => notebooks}/csv/data1.csv (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/architecture-thin.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/banner.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/drcp-architecture.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/drcp-comparison.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/jupyter-notebook-screenshot.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/lob-benchmark.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/pooled-connection.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/roundtrip.png (100%) rename python/python-oracledb/{sample_notebooks => notebooks}/images/standalone-connection.png (100%) create mode 100644 python/python-oracledb/pipelining_basic.py create mode 100644 python/python-oracledb/pipelining_error.py create mode 100644 python/python-oracledb/pipelining_parallel.py diff --git a/python/python-oracledb/README.md b/python/python-oracledb/README.md index f1a4e706..380ce058 100644 --- a/python/python-oracledb/README.md +++ b/python/python-oracledb/README.md @@ -34,8 +34,8 @@ build a container with the samples and a running Oracle Database. ### Notebooks -The [sample_notebooks](./sample_notebooks) directory has Jupyter notebooks with -runnable examples. +The [notebooks](./notebooks) directory has Jupyter notebooks with runnable +examples. ## About python-oracledb diff --git a/python/python-oracledb/app_context.py b/python/python-oracledb/app_context.py index 8757764d..2f733bae 100644 --- a/python/python-oracledb/app_context.py +++ b/python/python-oracledb/app_context.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -38,8 +38,9 @@ import oracledb import sample_env -# this script is currently only supported in python-oracledb thick mode -oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) # client context attributes to be set APP_CTX_NAMESPACE = "CLIENTCONTEXT" diff --git a/python/python-oracledb/array_dml_rowcounts.py b/python/python-oracledb/array_dml_rowcounts.py index 47fc3b1c..7a497f01 100644 --- a/python/python-oracledb/array_dml_rowcounts.py +++ b/python/python-oracledb/array_dml_rowcounts.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/array_dml_rowcounts_async.py b/python/python-oracledb/array_dml_rowcounts_async.py index 8b5b72b1..a8661af1 100644 --- a/python/python-oracledb/array_dml_rowcounts_async.py +++ b/python/python-oracledb/array_dml_rowcounts_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -44,6 +44,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/async_gather.py b/python/python-oracledb/async_gather.py index cc21fc1d..78b12937 100644 --- a/python/python-oracledb/async_gather.py +++ b/python/python-oracledb/async_gather.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -66,6 +66,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_pool_params(), min=1, max=CONCURRENCY, session_callback=init_session, diff --git a/python/python-oracledb/batch_errors.py b/python/python-oracledb/batch_errors.py index b5ef1b26..60e5a4bd 100644 --- a/python/python-oracledb/batch_errors.py +++ b/python/python-oracledb/batch_errors.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -44,6 +44,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/batch_errors_async.py b/python/python-oracledb/batch_errors_async.py index 3c865bbc..3297fb6a 100644 --- a/python/python-oracledb/batch_errors_async.py +++ b/python/python-oracledb/batch_errors_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -46,6 +46,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/bind_insert.py b/python/python-oracledb/bind_insert.py index 5bb6b3c6..abd7750f 100644 --- a/python/python-oracledb/bind_insert.py +++ b/python/python-oracledb/bind_insert.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -39,6 +39,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # ----------------------------------------------------------------------------- diff --git a/python/python-oracledb/bind_insert_async.py b/python/python-oracledb/bind_insert_async.py index 853281cf..2e3a3660 100644 --- a/python/python-oracledb/bind_insert_async.py +++ b/python/python-oracledb/bind_insert_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -41,6 +41,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # ------------------------------------------------------------------------- diff --git a/python/python-oracledb/bind_query.py b/python/python-oracledb/bind_query.py index e286cf4c..9a114cab 100644 --- a/python/python-oracledb/bind_query.py +++ b/python/python-oracledb/bind_query.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -44,6 +44,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # Bind by position with lists diff --git a/python/python-oracledb/bind_query_async.py b/python/python-oracledb/bind_query_async.py index 836bcdd5..69a938ad 100644 --- a/python/python-oracledb/bind_query_async.py +++ b/python/python-oracledb/bind_query_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -46,6 +46,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # Bind by position with lists diff --git a/python/python-oracledb/call_timeout.py b/python/python-oracledb/call_timeout.py index 965ed7fd..5fc59b1e 100644 --- a/python/python-oracledb/call_timeout.py +++ b/python/python-oracledb/call_timeout.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2019, 2023, Oracle and/or its affiliates. +# Copyright (c) 2019, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,6 +43,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) connection.call_timeout = 2000 diff --git a/python/python-oracledb/call_timeout_async.py b/python/python-oracledb/call_timeout_async.py index 446a710d..c136c01f 100644 --- a/python/python-oracledb/call_timeout_async.py +++ b/python/python-oracledb/call_timeout_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,6 +43,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) connection.call_timeout = 2000 diff --git a/python/python-oracledb/connection_pool.py b/python/python-oracledb/connection_pool.py index 92e6a2ad..dd76c05e 100644 --- a/python/python-oracledb/connection_pool.py +++ b/python/python-oracledb/connection_pool.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2022, 2023, Oracle and/or its affiliates. +# Copyright (c) 2022, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -89,6 +89,7 @@ def start_pool(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_pool_params(), min=pool_min, max=pool_max, increment=pool_inc, diff --git a/python/python-oracledb/create_schema.py b/python/python-oracledb/create_schema.py index d5ad7d93..d2bc0997 100644 --- a/python/python-oracledb/create_schema.py +++ b/python/python-oracledb/create_schema.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2020, 2023, Oracle and/or its affiliates. +# Copyright (c) 2020, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -54,7 +54,7 @@ sample_env.run_sql_script( conn, "create_schema_21", main_user=sample_env.get_main_user() ) -if sample_env.get_server_version() >= (23, 4): +if sample_env.get_server_version() >= (23, 5): sample_env.run_sql_script( conn, "create_schema_23", main_user=sample_env.get_main_user() ) diff --git a/python/python-oracledb/dbms_output.py b/python/python-oracledb/dbms_output.py index 0f2202ff..0366af84 100644 --- a/python/python-oracledb/dbms_output.py +++ b/python/python-oracledb/dbms_output.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2020, 2023, Oracle and/or its affiliates. +# Copyright (c) 2020, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -40,6 +40,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/dbms_output_async.py b/python/python-oracledb/dbms_output_async.py index a0f5b2d6..757db241 100644 --- a/python/python-oracledb/dbms_output_async.py +++ b/python/python-oracledb/dbms_output_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/dml_returning_multiple_rows.py b/python/python-oracledb/dml_returning_multiple_rows.py index f6464ba8..7f7765f4 100644 --- a/python/python-oracledb/dml_returning_multiple_rows.py +++ b/python/python-oracledb/dml_returning_multiple_rows.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -45,6 +45,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/dml_returning_multiple_rows_async.py b/python/python-oracledb/dml_returning_multiple_rows_async.py index 1a2963e0..2bda224b 100644 --- a/python/python-oracledb/dml_returning_multiple_rows_async.py +++ b/python/python-oracledb/dml_returning_multiple_rows_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/drcp_pool.py b/python/python-oracledb/drcp_pool.py index 3ff8aef8..2401021e 100644 --- a/python/python-oracledb/drcp_pool.py +++ b/python/python-oracledb/drcp_pool.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2022, 2023, Oracle and/or its affiliates. +# Copyright (c) 2022, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -137,6 +137,7 @@ def start_pool(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_drcp_connect_string(), + params=sample_env.get_pool_params(), min=pool_min, max=pool_max, increment=pool_inc, diff --git a/python/python-oracledb/editioning.py b/python/python-oracledb/editioning.py index 3ba403f8..c6d579d2 100644 --- a/python/python-oracledb/editioning.py +++ b/python/python-oracledb/editioning.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -41,8 +41,9 @@ import oracledb import sample_env -# this script is currently only supported in python-oracledb thick mode -oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) # connect to the editions user and create a procedure edition_connect_string = sample_env.get_edition_connect_string() diff --git a/python/python-oracledb/generic_row_factory.py b/python/python-oracledb/generic_row_factory.py index e1a4bbfd..b7821828 100644 --- a/python/python-oracledb/generic_row_factory.py +++ b/python/python-oracledb/generic_row_factory.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -61,6 +61,7 @@ def execute(self, statement, args=None): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/generic_row_factory_async.py b/python/python-oracledb/generic_row_factory_async.py index 4b4ed55a..e1efdbf4 100644 --- a/python/python-oracledb/generic_row_factory_async.py +++ b/python/python-oracledb/generic_row_factory_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -62,6 +62,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/implicit_results.py b/python/python-oracledb/implicit_results.py index c4ffe332..99e7ca6b 100644 --- a/python/python-oracledb/implicit_results.py +++ b/python/python-oracledb/implicit_results.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -46,6 +46,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/implicit_results_async.py b/python/python-oracledb/implicit_results_async.py index c2afc323..95841274 100644 --- a/python/python-oracledb/implicit_results_async.py +++ b/python/python-oracledb/implicit_results_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,6 +43,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/insert_geometry.py b/python/python-oracledb/insert_geometry.py index 60938fa2..bf6f5699 100644 --- a/python/python-oracledb/insert_geometry.py +++ b/python/python-oracledb/insert_geometry.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -45,6 +45,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # create and populate Oracle objects diff --git a/python/python-oracledb/insert_geometry_async.py b/python/python-oracledb/insert_geometry_async.py index a9058fde..22fe92d4 100644 --- a/python/python-oracledb/insert_geometry_async.py +++ b/python/python-oracledb/insert_geometry_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # create and populate Oracle objects diff --git a/python/python-oracledb/json_blob.py b/python/python-oracledb/json_blob.py index 90757fa7..61b8576f 100644 --- a/python/python-oracledb/json_blob.py +++ b/python/python-oracledb/json_blob.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2020, 2023, Oracle and/or its affiliates. +# Copyright (c) 2020, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -50,6 +50,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) if not connection.thin: diff --git a/python/python-oracledb/json_blob_async.py b/python/python-oracledb/json_blob_async.py index 7f7e18b8..d8b9221d 100644 --- a/python/python-oracledb/json_blob_async.py +++ b/python/python-oracledb/json_blob_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -51,6 +51,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # Minimum database vesion is 12 diff --git a/python/python-oracledb/json_direct.py b/python/python-oracledb/json_direct.py index fcccdf83..3b2219fb 100644 --- a/python/python-oracledb/json_direct.py +++ b/python/python-oracledb/json_direct.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2020, 2023, Oracle and/or its affiliates. +# Copyright (c) 2020, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -47,6 +47,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) if not connection.thin: diff --git a/python/python-oracledb/json_direct_async.py b/python/python-oracledb/json_direct_async.py index a2c19628..7272c842 100644 --- a/python/python-oracledb/json_direct_async.py +++ b/python/python-oracledb/json_direct_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -47,6 +47,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # this script only works with Oracle Database 21 diff --git a/python/python-oracledb/json_duality.py b/python/python-oracledb/json_duality.py index 393049e7..cc0829da 100644 --- a/python/python-oracledb/json_duality.py +++ b/python/python-oracledb/json_duality.py @@ -46,6 +46,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # this script only works with Oracle Database 23.5 or later diff --git a/python/python-oracledb/json_duality_async.py b/python/python-oracledb/json_duality_async.py index 6546d3c2..9fd8bf38 100644 --- a/python/python-oracledb/json_duality_async.py +++ b/python/python-oracledb/json_duality_async.py @@ -44,6 +44,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # this script only works with Oracle Database 23.5 or later diff --git a/python/python-oracledb/last_rowid.py b/python/python-oracledb/last_rowid.py index 323bc2c0..bbe3583b 100644 --- a/python/python-oracledb/last_rowid.py +++ b/python/python-oracledb/last_rowid.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2019, 2023, Oracle and/or its affiliates. +# Copyright (c) 2019, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -39,6 +39,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/last_rowid_async.py b/python/python-oracledb/last_rowid_async.py index 3f4a2a68..20c8e472 100644 --- a/python/python-oracledb/last_rowid_async.py +++ b/python/python-oracledb/last_rowid_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -41,6 +41,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/load_csv.py b/python/python-oracledb/load_csv.py index 045c1c88..49d28e10 100644 --- a/python/python-oracledb/load_csv.py +++ b/python/python-oracledb/load_csv.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2022, 2023, Oracle and/or its affiliates. +# Copyright (c) 2022, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -53,6 +53,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) diff --git a/python/python-oracledb/load_csv_async.py b/python/python-oracledb/load_csv_async.py index e862e733..3a5be68b 100644 --- a/python/python-oracledb/load_csv_async.py +++ b/python/python-oracledb/load_csv_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -54,6 +54,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) async def process_batch(batch_number, cursor, data): diff --git a/python/python-oracledb/sample_notebooks/1-Connection.ipynb b/python/python-oracledb/notebooks/1-Connection.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/1-Connection.ipynb rename to python/python-oracledb/notebooks/1-Connection.ipynb diff --git a/python/python-oracledb/sample_notebooks/2-Queries.ipynb b/python/python-oracledb/notebooks/2-Queries.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/2-Queries.ipynb rename to python/python-oracledb/notebooks/2-Queries.ipynb diff --git a/python/python-oracledb/sample_notebooks/3-DML.ipynb b/python/python-oracledb/notebooks/3-DML.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/3-DML.ipynb rename to python/python-oracledb/notebooks/3-DML.ipynb diff --git a/python/python-oracledb/sample_notebooks/4-CSV.ipynb b/python/python-oracledb/notebooks/4-CSV.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/4-CSV.ipynb rename to python/python-oracledb/notebooks/4-CSV.ipynb diff --git a/python/python-oracledb/sample_notebooks/5-JSON.ipynb b/python/python-oracledb/notebooks/5-JSON.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/5-JSON.ipynb rename to python/python-oracledb/notebooks/5-JSON.ipynb diff --git a/python/python-oracledb/sample_notebooks/6-PLSQL.ipynb b/python/python-oracledb/notebooks/6-PLSQL.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/6-PLSQL.ipynb rename to python/python-oracledb/notebooks/6-PLSQL.ipynb diff --git a/python/python-oracledb/sample_notebooks/7-Objects.ipynb b/python/python-oracledb/notebooks/7-Objects.ipynb similarity index 100% rename from python/python-oracledb/sample_notebooks/7-Objects.ipynb rename to python/python-oracledb/notebooks/7-Objects.ipynb diff --git a/python/python-oracledb/sample_notebooks/README.md b/python/python-oracledb/notebooks/README.md similarity index 98% rename from python/python-oracledb/sample_notebooks/README.md rename to python/python-oracledb/notebooks/README.md index dee07944..37d2a382 100644 --- a/python/python-oracledb/sample_notebooks/README.md +++ b/python/python-oracledb/notebooks/README.md @@ -67,7 +67,7 @@ Install the schema: ### Start Jupyter - cd sample_notebooks + cd notebooks jupyter notebook If Jupyter is not in your path, you may need to find it on your computer and diff --git a/python/python-oracledb/sample_notebooks/csv/data1.csv b/python/python-oracledb/notebooks/csv/data1.csv similarity index 100% rename from python/python-oracledb/sample_notebooks/csv/data1.csv rename to python/python-oracledb/notebooks/csv/data1.csv diff --git a/python/python-oracledb/sample_notebooks/images/architecture-thin.png b/python/python-oracledb/notebooks/images/architecture-thin.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/architecture-thin.png rename to python/python-oracledb/notebooks/images/architecture-thin.png diff --git a/python/python-oracledb/sample_notebooks/images/banner.png b/python/python-oracledb/notebooks/images/banner.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/banner.png rename to python/python-oracledb/notebooks/images/banner.png diff --git a/python/python-oracledb/sample_notebooks/images/drcp-architecture.png b/python/python-oracledb/notebooks/images/drcp-architecture.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/drcp-architecture.png rename to python/python-oracledb/notebooks/images/drcp-architecture.png diff --git a/python/python-oracledb/sample_notebooks/images/drcp-comparison.png b/python/python-oracledb/notebooks/images/drcp-comparison.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/drcp-comparison.png rename to python/python-oracledb/notebooks/images/drcp-comparison.png diff --git a/python/python-oracledb/sample_notebooks/images/jupyter-notebook-screenshot.png b/python/python-oracledb/notebooks/images/jupyter-notebook-screenshot.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/jupyter-notebook-screenshot.png rename to python/python-oracledb/notebooks/images/jupyter-notebook-screenshot.png diff --git a/python/python-oracledb/sample_notebooks/images/lob-benchmark.png b/python/python-oracledb/notebooks/images/lob-benchmark.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/lob-benchmark.png rename to python/python-oracledb/notebooks/images/lob-benchmark.png diff --git a/python/python-oracledb/sample_notebooks/images/pooled-connection.png b/python/python-oracledb/notebooks/images/pooled-connection.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/pooled-connection.png rename to python/python-oracledb/notebooks/images/pooled-connection.png diff --git a/python/python-oracledb/sample_notebooks/images/roundtrip.png b/python/python-oracledb/notebooks/images/roundtrip.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/roundtrip.png rename to python/python-oracledb/notebooks/images/roundtrip.png diff --git a/python/python-oracledb/sample_notebooks/images/standalone-connection.png b/python/python-oracledb/notebooks/images/standalone-connection.png similarity index 100% rename from python/python-oracledb/sample_notebooks/images/standalone-connection.png rename to python/python-oracledb/notebooks/images/standalone-connection.png diff --git a/python/python-oracledb/object_dump.py b/python/python-oracledb/object_dump.py index 741d9a10..b6ce6412 100644 --- a/python/python-oracledb/object_dump.py +++ b/python/python-oracledb/object_dump.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -41,6 +41,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) cursor = connection.cursor() diff --git a/python/python-oracledb/object_dump_async.py b/python/python-oracledb/object_dump_async.py index 50e9a028..9061c3ef 100644 --- a/python/python-oracledb/object_dump_async.py +++ b/python/python-oracledb/object_dump_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,6 +43,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) cursor = connection.cursor() diff --git a/python/python-oracledb/pipelining_basic.py b/python/python-oracledb/pipelining_basic.py new file mode 100644 index 00000000..76bb1786 --- /dev/null +++ b/python/python-oracledb/pipelining_basic.py @@ -0,0 +1,92 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2024, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# pipelining_basic.py +# +# Demonstrates Oracle Database Pipelining. +# True pipelining is only available when connected to Oracle Database 23ai +# ----------------------------------------------------------------------------- + +import asyncio + +import oracledb +import sample_env + + +async def main(): + connection = await oracledb.connect_async( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), + ) + + # ------------------------------------------------------------ + + # Create a pipeline and define the operations + pipeline = oracledb.create_pipeline() + + pipeline.add_fetchone("select user from dual") + + pipeline.add_fetchone("select sysdate from dual") + + rows = [ + (1, "First"), + (2, "Second"), + (3, "Third"), + (4, "Fourth"), + (5, "Fifth"), + (6, "Sixth"), + ] + pipeline.add_executemany( + "insert into mytab(id, data) values (:1, :2)", rows + ) + + # pipeline.add_commit() # uncomment to persist data + + pipeline.add_fetchall("select * from mytab") + + # Run the operations in the pipeline. + # Note although the database receives all the operations at the same time, + # it will execute each operation sequentially + results = await connection.run_pipeline(pipeline) + + # Print the query results + for i, result in enumerate(results): + if result.rows: + statement = pipeline.operations[i].statement + print(f"\nRows from operation {i+1} '{statement}':\n") + headings = [col.name for col in result.columns] + print(*headings, sep="\t") + print("--") + for row in result.rows: + print(*row, sep="\t") + + # ------------------------------------------------------------ + + await connection.close() + + +asyncio.run(main()) diff --git a/python/python-oracledb/pipelining_error.py b/python/python-oracledb/pipelining_error.py new file mode 100644 index 00000000..92190083 --- /dev/null +++ b/python/python-oracledb/pipelining_error.py @@ -0,0 +1,106 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2024, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# pipelining_error.py +# +# Demonstrates warnings and errors with Oracle Database Pipelining. +# True pipelining is only available when connected to Oracle Database 23ai +# ----------------------------------------------------------------------------- + +import asyncio + +import oracledb +import sample_env + + +async def main(): + connection = await oracledb.connect_async( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), + ) + + # ------------------------------------------------------------ + + print("\nExecution exception:\n") + + try: + pipeline = oracledb.create_pipeline() + pipeline.add_fetchall("select 1 from does_not_exist_1") + pipeline.add_fetchall("select 2 from does_not_exist_2") + + # By default, the first failure throws an exception + await connection.run_pipeline(pipeline) + + except oracledb.Error as e: + (error,) = e.args + print(error.message) + + # ------------------------------------------------------------ + + print("\nContinuing after first error:\n") + + pipeline = oracledb.create_pipeline() + pipeline.add_execute( + """create or replace procedure myproc as + begin + bogus; + end;""" + ) + pipeline.add_fetchall("select 1 from does_not_exist_3") + pipeline.add_fetchall("select 2 from does_not_exist_4") + pipeline.add_fetchall("select dummy from dual") + results = await connection.run_pipeline(pipeline, continue_on_error=True) + + for i, result in enumerate(results): + statement = pipeline.operations[i].statement + if result.warning: + print( + f"Warning {result.warning.full_code} " f"in operation {i+1}:\n" + ) + print(statement) + print(f"{result.warning}\n") + elif result.error: + print( + f"Error {result.error.full_code} " + f"at position {result.error.offset+1} " + f"in operation {i+1}:\n" + ) + print(statement) + print(f"{result.error}\n") + elif result.rows: + print(f"Rows from operation {i+1}:\n") + print(statement) + for row in result.rows: + print(row) + + # ------------------------------------------------------------ + + await connection.execute("drop procedure myproc") + await connection.close() + + +asyncio.run(main()) diff --git a/python/python-oracledb/pipelining_parallel.py b/python/python-oracledb/pipelining_parallel.py new file mode 100644 index 00000000..4b318a71 --- /dev/null +++ b/python/python-oracledb/pipelining_parallel.py @@ -0,0 +1,79 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2024, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# pipelining_parallel.py +# +# Demonstrates Oracle Database Pipelining running local and database operations +# concurrently. +# True pipelining is only available when connected to Oracle Database 23ai +# ----------------------------------------------------------------------------- + +import asyncio + +import oracledb +import sample_env + + +async def run_thing_one(): + return "thing_one" + + +async def run_thing_two(): + return "thing_two" + + +async def main(): + connection = await oracledb.connect_async( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), + ) + + pipeline = oracledb.create_pipeline() + pipeline.add_fetchone("select user from dual") + pipeline.add_fetchone("select sysdate from dual") + + # Run the pipeline and non-database operations concurrently. + # Note although the database receives all the operations at the same time, + # it will execute each operation sequentially. It is the local and + # database tasks that execute concurrently. + return_values = await asyncio.gather( + run_thing_one(), run_thing_two(), connection.run_pipeline(pipeline) + ) + + for r in return_values: + if isinstance(r, list): # the pipeline return list + for result in r: + if result.rows: + for row in result.rows: + print(*row, sep="\t") + else: + print(r) # a local operation result + + await connection.close() + + +asyncio.run(main()) diff --git a/python/python-oracledb/plsql_collection.py b/python/python-oracledb/plsql_collection.py index 33687031..009f581c 100644 --- a/python/python-oracledb/plsql_collection.py +++ b/python/python-oracledb/plsql_collection.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # create a new empty object of the correct type. diff --git a/python/python-oracledb/plsql_collection_async.py b/python/python-oracledb/plsql_collection_async.py index e39d11f7..a6d07e98 100644 --- a/python/python-oracledb/plsql_collection_async.py +++ b/python/python-oracledb/plsql_collection_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -44,6 +44,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # create a new empty object of the correct type. diff --git a/python/python-oracledb/plsql_function.py b/python/python-oracledb/plsql_function.py index 36679742..5d75a743 100644 --- a/python/python-oracledb/plsql_function.py +++ b/python/python-oracledb/plsql_function.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -39,6 +39,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/plsql_function_async.py b/python/python-oracledb/plsql_function_async.py index 4606c3ba..df10d73e 100644 --- a/python/python-oracledb/plsql_function_async.py +++ b/python/python-oracledb/plsql_function_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -41,6 +41,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/plsql_procedure.py b/python/python-oracledb/plsql_procedure.py index 7703cff3..3a30879f 100644 --- a/python/python-oracledb/plsql_procedure.py +++ b/python/python-oracledb/plsql_procedure.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -40,6 +40,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/plsql_procedure_async.py b/python/python-oracledb/plsql_procedure_async.py index d5c9875e..eefe48cb 100644 --- a/python/python-oracledb/plsql_procedure_async.py +++ b/python/python-oracledb/plsql_procedure_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/plsql_record.py b/python/python-oracledb/plsql_record.py index d3bc2a9c..e6962230 100644 --- a/python/python-oracledb/plsql_record.py +++ b/python/python-oracledb/plsql_record.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,6 +43,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # create new object of the correct type diff --git a/python/python-oracledb/plsql_record_async.py b/python/python-oracledb/plsql_record_async.py index 633b1f40..61c5165a 100644 --- a/python/python-oracledb/plsql_record_async.py +++ b/python/python-oracledb/plsql_record_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -44,6 +44,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # create new object of the correct type diff --git a/python/python-oracledb/plsql_rowtype.py b/python/python-oracledb/plsql_rowtype.py index aebbefb8..d7d38538 100644 --- a/python/python-oracledb/plsql_rowtype.py +++ b/python/python-oracledb/plsql_rowtype.py @@ -39,6 +39,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/plsql_rowtype_async.py b/python/python-oracledb/plsql_rowtype_async.py index 8a02e41a..68371897 100644 --- a/python/python-oracledb/plsql_rowtype_async.py +++ b/python/python-oracledb/plsql_rowtype_async.py @@ -41,6 +41,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/query.py b/python/python-oracledb/query.py index 8a0d42e6..283e0b1b 100644 --- a/python/python-oracledb/query.py +++ b/python/python-oracledb/query.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -39,6 +39,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) sql = """select * from SampleQueryTab diff --git a/python/python-oracledb/query_arraysize.py b/python/python-oracledb/query_arraysize.py index 3d1af672..9ef713bb 100644 --- a/python/python-oracledb/query_arraysize.py +++ b/python/python-oracledb/query_arraysize.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -48,6 +48,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # Global values can be set to override the defaults used when a cursor is diff --git a/python/python-oracledb/query_arraysize_async.py b/python/python-oracledb/query_arraysize_async.py index 965bcc8c..ec6330fc 100644 --- a/python/python-oracledb/query_arraysize_async.py +++ b/python/python-oracledb/query_arraysize_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -49,6 +49,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # Global values can be set to override the defaults used when a cursor is diff --git a/python/python-oracledb/query_async.py b/python/python-oracledb/query_async.py index d12b4a59..bd5f97a9 100644 --- a/python/python-oracledb/query_async.py +++ b/python/python-oracledb/query_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -41,6 +41,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) sql = """select * from SampleQueryTab diff --git a/python/python-oracledb/query_strings_as_bytes.py b/python/python-oracledb/query_strings_as_bytes.py index 102c097b..fa2115bd 100644 --- a/python/python-oracledb/query_strings_as_bytes.py +++ b/python/python-oracledb/query_strings_as_bytes.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2021, 2023, Oracle and/or its affiliates. +# Copyright (c) 2021, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -49,6 +49,7 @@ def return_strings_as_bytes(cursor, metadata): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # truncate table and populate with our data of choice diff --git a/python/python-oracledb/query_strings_as_bytes_async.py b/python/python-oracledb/query_strings_as_bytes_async.py index 984ec02c..df64db39 100644 --- a/python/python-oracledb/query_strings_as_bytes_async.py +++ b/python/python-oracledb/query_strings_as_bytes_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -50,6 +50,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) # truncate table and populate with our data of choice diff --git a/python/python-oracledb/ref_cursor.py b/python/python-oracledb/ref_cursor.py index d6a99ed1..537fae6b 100644 --- a/python/python-oracledb/ref_cursor.py +++ b/python/python-oracledb/ref_cursor.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -41,6 +41,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/ref_cursor_async.py b/python/python-oracledb/ref_cursor_async.py index 8de5b727..4abbca40 100644 --- a/python/python-oracledb/ref_cursor_async.py +++ b/python/python-oracledb/ref_cursor_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -42,6 +42,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) ref_cursor = connection.cursor() diff --git a/python/python-oracledb/return_lobs_as_strings.py b/python/python-oracledb/return_lobs_as_strings.py index 71a33e39..4e07a57e 100644 --- a/python/python-oracledb/return_lobs_as_strings.py +++ b/python/python-oracledb/return_lobs_as_strings.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -51,6 +51,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/return_lobs_as_strings_async.py b/python/python-oracledb/return_lobs_as_strings_async.py index 8259cfb6..686d5a46 100644 --- a/python/python-oracledb/return_lobs_as_strings_async.py +++ b/python/python-oracledb/return_lobs_as_strings_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -48,6 +48,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/return_numbers_as_decimals.py b/python/python-oracledb/return_numbers_as_decimals.py index eaeed69c..aef2bf26 100644 --- a/python/python-oracledb/return_numbers_as_decimals.py +++ b/python/python-oracledb/return_numbers_as_decimals.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -46,6 +46,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/return_numbers_as_decimals_async.py b/python/python-oracledb/return_numbers_as_decimals_async.py index f304e98c..d3a063a6 100644 --- a/python/python-oracledb/return_numbers_as_decimals_async.py +++ b/python/python-oracledb/return_numbers_as_decimals_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -48,6 +48,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/rows_as_instance.py b/python/python-oracledb/rows_as_instance.py index 67973a93..c17150c7 100644 --- a/python/python-oracledb/rows_as_instance.py +++ b/python/python-oracledb/rows_as_instance.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -54,6 +54,7 @@ def __init__(self, a, b, c): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/rows_as_instance_async.py b/python/python-oracledb/rows_as_instance_async.py index 41a0402b..9ceaba4d 100644 --- a/python/python-oracledb/rows_as_instance_async.py +++ b/python/python-oracledb/rows_as_instance_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -50,6 +50,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/sample_container/Dockerfile b/python/python-oracledb/sample_container/Dockerfile index 85caa1a3..abae563c 100644 --- a/python/python-oracledb/sample_container/Dockerfile +++ b/python/python-oracledb/sample_container/Dockerfile @@ -86,7 +86,7 @@ WORKDIR /samples/ RUN curl -LO https://github.com/oracle/python-oracledb/archive/refs/heads/main.zip && \ unzip main.zip && \ cp python-oracledb-main/samples/sample_container/setup.py . && \ - /bin/rm -rf python-oracledb-main/samples/sample_container/ python-oracledb-main/samples/sample_notebooks/ && \ + /bin/rm -rf python-oracledb-main/samples/sample_container/ python-oracledb-main/samples/notebooks/ && \ mv python-oracledb-main/samples/* . && \ /bin/rm -rf python-oracledb-main samples main.zip && \ cat create_schema.py >> /samples/setup.py && \ diff --git a/python/python-oracledb/sample_env.py b/python/python-oracledb/sample_env.py index b975796c..062f0dd7 100644 --- a/python/python-oracledb/sample_env.py +++ b/python/python-oracledb/sample_env.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -40,6 +40,8 @@ # PYO_SAMPLES_EDITION_USER: user to be created for editiong samples # PYO_SAMPLES_EDITION_PASSWORD: password of PYO_SAMPLES_EDITION_USER # PYO_SAMPLES_EDITION_NAME: name of edition for editioning samples +# PYO_SAMPLES_WALLET_LOCATION: location of wallet file (thin mode, mTLS) +# PYO_SAMPLES_WALLET_PASSWORD: password for wallet file (thin mode, mTLS) # PYO_SAMPLES_DRIVER_MODE: python-oracledb mode (Thick or thin) to use # # - On Windows set PYO_SAMPLES_ORACLE_CLIENT_PATH if Oracle libraries are not @@ -156,6 +158,21 @@ def get_edition_name(): ) +def get_connect_params(cls=oracledb.ConnectParams): + wallet_location = get_wallet_location() + if wallet_location is not None: + return cls( + config_dir=wallet_location, + wallet_location=wallet_location, + wallet_password=get_wallet_password(), + disable_oob=True, + ) + + +def get_pool_params(): + return get_connect_params(cls=oracledb.PoolParams) + + def get_connect_string(): return get_value( "PYO_SAMPLES_CONNECT_STRING", "Connect String", DEFAULT_CONNECT_STRING @@ -229,6 +246,18 @@ def get_server_version(): return value +def get_wallet_location(): + if get_is_thin(): + return get_value("PYO_SAMPLES_WALLET_LOCATION", "Wallet Location") + + +def get_wallet_password(): + if get_is_thin() and get_wallet_location(): + return get_value( + "PYO_SAMPLES_WALLET_PASSWORD", "Wallet Password", password=True + ) + + def run_sql_script(conn, script_name, **kwargs): statement_parts = [] cursor = conn.cursor() diff --git a/python/python-oracledb/session_callback.py b/python/python-oracledb/session_callback.py index 182fe24a..26110592 100644 --- a/python/python-oracledb/session_callback.py +++ b/python/python-oracledb/session_callback.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2019, 2023, Oracle and/or its affiliates. +# Copyright (c) 2019, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -97,6 +97,7 @@ def start_pool(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_pool_params(), min=4, max=4, increment=0, diff --git a/python/python-oracledb/soda_json_duality.py b/python/python-oracledb/soda_json_duality.py index c6ea12d8..ac75882f 100644 --- a/python/python-oracledb/soda_json_duality.py +++ b/python/python-oracledb/soda_json_duality.py @@ -29,7 +29,7 @@ # Simple Oracle Document Access (SODA). # # Oracle Client must be at 23.4 or higher. -# Oracle Database must be at 23.4 or higher. +# Oracle Database must be at 23.5 or higher. # The user must have been granted the SODA_APP privilege. # # Also see json_duality.py diff --git a/python/python-oracledb/spatial_to_geopandas.py b/python/python-oracledb/spatial_to_geopandas.py index d4e634ff..5fe8f496 100644 --- a/python/python-oracledb/spatial_to_geopandas.py +++ b/python/python-oracledb/spatial_to_geopandas.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2018, 2023, Oracle and/or its affiliates. +# Copyright (c) 2018, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -58,6 +58,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) cursor = connection.cursor() diff --git a/python/python-oracledb/sql/create_schema_23.sql b/python/python-oracledb/sql/create_schema_23.sql index 75deb8ee..e96e7f86 100644 --- a/python/python-oracledb/sql/create_schema_23.sql +++ b/python/python-oracledb/sql/create_schema_23.sql @@ -27,14 +27,15 @@ * * Performs the actual work of creating and populating the schemas with the * database objects used by the python-oracledb samples that require Oracle - * Database 23.4 or higher. It is executed by the Python script + * Database 23.5 or higher. It is executed by the Python script * create_schema.py. *---------------------------------------------------------------------------*/ create table &main_user..SampleVectorTab ( - v32 vector(3, float32), - v64 vector(3, float64), - v8 vector(3, int8) + v32 vector(3, float32), + v64 vector(3, float64), + v8 vector(3, int8), + vbin vector(24, binary) ) / @@ -51,26 +52,20 @@ create table &main_user..SampleJRDVBookTab ( ) / -insert into &main_user..SampleJRDVAuthorTab values (1, 'Isabel M. Rich') -/ -insert into &main_user..SampleJRDVAuthorTab values (2, 'Bobbie Cool') -/ -insert into &main_user..SampleJRDVAuthorTab values (3, 'Charlie Shore') +insert into &main_user..SampleJRDVAuthorTab values + (1, 'Isabel M. Rich'), + (2, 'Bobbie Cool'), + (3, 'Charlie Shore') / -insert into &main_user..SampleJRDVBookTab values (1, 'The Mysterious Dog', 1) -/ -insert into &main_user..SampleJRDVBookTab values (2, 'The Mysterious Pony', 1) -/ -insert into &main_user..SampleJRDVBookTab values (3, 'The Mysterious Tiger', 1) -/ -insert into &main_user..SampleJRDVBookTab values (4, 'Self Help for Programmers', 2) -/ -insert into &main_user..SampleJRDVBookTab values (5, 'More Self Help for Programmers', 2) -/ -insert into &main_user..SampleJRDVBookTab values (6, 'Travel Guide Volume I', 3) -/ -insert into &main_user..SampleJRDVBookTab values (7, 'Travel Guide Volume II', 3) +insert into &main_user..SampleJRDVBookTab values + (1, 'The Mysterious Dog', 1), + (2, 'The Mysterious Pony', 1), + (3, 'The Mysterious Tiger', 1), + (4, 'Self Help for Programmers', 2), + (5, 'More Self Help for Programmers', 2), + (6, 'Travel Guide Volume I', 3), + (7, 'Travel Guide Volume II', 3) / commit diff --git a/python/python-oracledb/subclassing.py b/python/python-oracledb/subclassing.py index 4ebccbde..a1ca8aca 100644 --- a/python/python-oracledb/subclassing.py +++ b/python/python-oracledb/subclassing.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -48,6 +48,7 @@ def __init__(self): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) def cursor(self): diff --git a/python/python-oracledb/subclassing_async.py b/python/python-oracledb/subclassing_async.py index 94f2a7ef..3d2ec024 100644 --- a/python/python-oracledb/subclassing_async.py +++ b/python/python-oracledb/subclassing_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -67,6 +67,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), conn_class=Connection, ) diff --git a/python/python-oracledb/type_handlers_json_strings.py b/python/python-oracledb/type_handlers_json_strings.py index c5fb48cc..a523cd2e 100644 --- a/python/python-oracledb/type_handlers_json_strings.py +++ b/python/python-oracledb/type_handlers_json_strings.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2022, 2023, Oracle and/or its affiliates. +# Copyright (c) 2022, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -97,6 +97,7 @@ def output_type_handler(cursor, metadata): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/type_handlers_json_strings_async.py b/python/python-oracledb/type_handlers_json_strings_async.py index e0788900..710342c3 100644 --- a/python/python-oracledb/type_handlers_json_strings_async.py +++ b/python/python-oracledb/type_handlers_json_strings_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -97,6 +97,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/type_handlers_objects.py b/python/python-oracledb/type_handlers_objects.py index 1b5af01b..903e011e 100644 --- a/python/python-oracledb/type_handlers_objects.py +++ b/python/python-oracledb/type_handlers_objects.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -49,6 +49,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) obj_type = connection.gettype("UDT_BUILDING") diff --git a/python/python-oracledb/type_handlers_objects_async.py b/python/python-oracledb/type_handlers_objects_async.py index 86924fd0..f406ace4 100644 --- a/python/python-oracledb/type_handlers_objects_async.py +++ b/python/python-oracledb/type_handlers_objects_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -63,6 +63,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) obj_type = await connection.gettype("UDT_BUILDING") diff --git a/python/python-oracledb/universal_rowids.py b/python/python-oracledb/universal_rowids.py index f4c486c1..822b0076 100644 --- a/python/python-oracledb/universal_rowids.py +++ b/python/python-oracledb/universal_rowids.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2017, 2023, Oracle and/or its affiliates. +# Copyright (c) 2017, 2024, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -54,6 +54,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/universal_rowids_async.py b/python/python-oracledb/universal_rowids_async.py index 7181519c..0ad58876 100644 --- a/python/python-oracledb/universal_rowids_async.py +++ b/python/python-oracledb/universal_rowids_async.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -49,6 +49,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/vector.py b/python/python-oracledb/vector.py index 9d2965c8..49f90bbf 100644 --- a/python/python-oracledb/vector.py +++ b/python/python-oracledb/vector.py @@ -42,18 +42,19 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) -# this script only works with Oracle Database 23.4 or later -if sample_env.get_server_version() < (23, 4): - sys.exit("This example requires Oracle Database 23.4 or later.") +# this script only works with Oracle Database 23.5 or later +if sample_env.get_server_version() < (23, 5): + sys.exit("This example requires Oracle Database 23.5 or later.") -# this script works with thin mode, or with thick mode using Oracle Client 23.4 +# this script works with thin mode, or with thick mode using Oracle Client 23.5 # or later -if not connection.thin and oracledb.clientversion()[:2] < (23, 4): +if not connection.thin and oracledb.clientversion()[:2] < (23, 5): sys.exit( "This example requires python-oracledb thin mode, or Oracle Client" - " 23.4 or later" + " 23.5 or later" ) with connection.cursor() as cursor: @@ -61,28 +62,33 @@ vector1_data_32 = array.array("f", [1.625, 1.5, 1.0]) vector1_data_64 = array.array("d", [11.25, 11.75, 11.5]) vector1_data_8 = array.array("b", [1, 2, 3]) + vector1_data_bin = array.array("B", [180, 150, 100]) cursor.execute( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", - [vector1_data_32, vector1_data_64, vector1_data_8], + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", + [vector1_data_32, vector1_data_64, vector1_data_8, vector1_data_bin], ) # Multi-row insert vector2_data_32 = array.array("f", [2.625, 2.5, 2.0]) vector2_data_64 = array.array("d", [22.25, 22.75, 22.5]) vector2_data_8 = array.array("b", [4, 5, 6]) + vector2_data_bin = array.array("B", [40, 15, 255]) vector3_data_32 = array.array("f", [3.625, 3.5, 3.0]) vector3_data_64 = array.array("d", [33.25, 33.75, 33.5]) vector3_data_8 = array.array("b", [7, 8, 9]) + vector3_data_bin = array.array("B", [0, 17, 101]) rows = [ - (vector2_data_32, vector2_data_64, vector2_data_8), - (vector3_data_32, vector3_data_64, vector3_data_8), + (vector2_data_32, vector2_data_64, vector2_data_8, vector2_data_bin), + (vector3_data_32, vector3_data_64, vector3_data_8, vector3_data_bin), ] cursor.executemany( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", rows, ) diff --git a/python/python-oracledb/vector_async.py b/python/python-oracledb/vector_async.py index 323ad5f7..1f349e70 100644 --- a/python/python-oracledb/vector_async.py +++ b/python/python-oracledb/vector_async.py @@ -43,39 +43,60 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) - # this script only works with Oracle Database 23.4 or later - if sample_env.get_server_version() < (23, 4): - sys.exit("This example requires Oracle Database 23.4 or later.") + # this script only works with Oracle Database 23.5 or later + if sample_env.get_server_version() < (23, 5): + sys.exit("This example requires Oracle Database 23.5 or later.") with connection.cursor() as cursor: # Single-row insert vector1_data_32 = array.array("f", [1.625, 1.5, 1.0]) vector1_data_64 = array.array("d", [11.25, 11.75, 11.5]) vector1_data_8 = array.array("b", [1, 2, 3]) + vector1_data_bin = array.array("B", [180, 150, 100]) await cursor.execute( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", - [vector1_data_32, vector1_data_64, vector1_data_8], + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", + [ + vector1_data_32, + vector1_data_64, + vector1_data_8, + vector1_data_bin, + ], ) # Multi-row insert vector2_data_32 = array.array("f", [2.625, 2.5, 2.0]) vector2_data_64 = array.array("d", [22.25, 22.75, 22.5]) vector2_data_8 = array.array("b", [4, 5, 6]) + vector2_data_bin = array.array("B", [40, 15, 255]) vector3_data_32 = array.array("f", [3.625, 3.5, 3.0]) vector3_data_64 = array.array("d", [33.25, 33.75, 33.5]) vector3_data_8 = array.array("b", [7, 8, 9]) + vector3_data_bin = array.array("B", [0, 17, 101]) rows = [ - (vector2_data_32, vector2_data_64, vector2_data_8), - (vector3_data_32, vector3_data_64, vector3_data_8), + ( + vector2_data_32, + vector2_data_64, + vector2_data_8, + vector2_data_bin, + ), + ( + vector3_data_32, + vector3_data_64, + vector3_data_8, + vector3_data_bin, + ), ] await cursor.executemany( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", rows, ) diff --git a/python/python-oracledb/vector_numpy.py b/python/python-oracledb/vector_numpy.py index 75553483..e16a2f2d 100644 --- a/python/python-oracledb/vector_numpy.py +++ b/python/python-oracledb/vector_numpy.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,18 +43,19 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) -# this script only works with Oracle Database 23.4 or later -if sample_env.get_server_version() < (23, 4): - sys.exit("This example requires Oracle Database 23.4 or later.") +# this script only works with Oracle Database 23.5 or later +if sample_env.get_server_version() < (23, 5): + sys.exit("This example requires Oracle Database 23.5 or later.") -# this script works with thin mode, or with thick mode using Oracle Client 23.4 +# this script works with thin mode, or with thick mode using Oracle Client 23.5 # or later -if not connection.thin and oracledb.clientversion()[:2] < (23, 4): +if not connection.thin and oracledb.clientversion()[:2] < (23, 5): sys.exit( "This example requires python-oracledb thin mode, or Oracle Client" - " 23.4 or later" + " 23.5 or later" ) @@ -64,6 +65,8 @@ def numpy_converter_in(value): dtype = "d" elif value.dtype == numpy.float32: dtype = "f" + elif value.dtype == numpy.uint8: + dtype = "B" else: dtype = "b" return array.array(dtype, value) @@ -83,13 +86,7 @@ def input_type_handler(cursor, value, arraysize): # Convert from array types to NumPy ndarray types when fetching vectors def numpy_converter_out(value): - if value.typecode == "b": - dtype = numpy.int8 - elif value.typecode == "f": - dtype = numpy.float32 - else: - dtype = numpy.float64 - return numpy.array(value, copy=False, dtype=dtype) + return numpy.array(value, copy=False, dtype=value.typecode) def output_type_handler(cursor, metadata): @@ -106,13 +103,15 @@ def output_type_handler(cursor, metadata): with connection.cursor() as cursor: # Insert - vector_data_32 = numpy.array([1.625, 1.5, 1.0]) - vector_data_64 = numpy.array([11.25, 11.75, 11.5]) - vector_data_8 = numpy.array([1, 2, 3]) + vector_data_32 = numpy.array([1.625, 1.5, 1.0], dtype=numpy.float32) + vector_data_64 = numpy.array([11.25, 11.75, 11.5], dtype=numpy.float64) + vector_data_8 = numpy.array([1, 2, 3], dtype=numpy.int8) + vector_data_vb = numpy.array([180, 150, 100], dtype=numpy.uint8) cursor.execute( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", - [vector_data_32, vector_data_64, vector_data_8], + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", + [vector_data_32, vector_data_64, vector_data_8, vector_data_vb], ) # Query diff --git a/python/python-oracledb/vector_numpy_async.py b/python/python-oracledb/vector_numpy_async.py index 87de54de..55afbd52 100644 --- a/python/python-oracledb/vector_numpy_async.py +++ b/python/python-oracledb/vector_numpy_async.py @@ -45,11 +45,12 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) - # this script only works with Oracle Database 23.4 or later - if sample_env.get_server_version() < (23, 4): - sys.exit("This example requires Oracle Database 23.4 or later.") + # this script only works with Oracle Database 23.5 or later + if sample_env.get_server_version() < (23, 5): + sys.exit("This example requires Oracle Database 23.5 or later.") # Convert from NumPy ndarray types to array types when inserting vectors def numpy_converter_in(value): @@ -57,6 +58,8 @@ def numpy_converter_in(value): dtype = "d" elif value.dtype == numpy.float32: dtype = "f" + elif value.dtype == numpy.uint8: + dtype = "B" else: dtype = "b" return array.array(dtype, value) @@ -73,13 +76,7 @@ def input_type_handler(cursor, value, arraysize): # Convert from array types to NumPy ndarray types when fetching vectors def numpy_converter_out(value): - if value.typecode == "b": - dtype = numpy.int8 - elif value.typecode == "f": - dtype = numpy.float32 - else: - dtype = numpy.float64 - return numpy.array(value, copy=False, dtype=dtype) + return numpy.array(value, copy=False, dtype=value.typecode) def output_type_handler(cursor, metadata): if metadata.type_code is oracledb.DB_TYPE_VECTOR: @@ -93,13 +90,15 @@ def output_type_handler(cursor, metadata): with connection.cursor() as cursor: # Insert - vector_data_32 = numpy.array([1.625, 1.5, 1.0]) - vector_data_64 = numpy.array([11.25, 11.75, 11.5]) - vector_data_8 = numpy.array([1, 2, 3]) + vector_data_32 = numpy.array([1.625, 1.5, 1.0], dtype=numpy.float32) + vector_data_64 = numpy.array([11.25, 11.75, 11.5], dtype=numpy.float64) + vector_data_8 = numpy.array([1, 2, 3], dtype=numpy.int8) + vector_data_vb = numpy.array([180, 150, 100], dtype=numpy.uint8) await cursor.execute( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", - [vector_data_32, vector_data_64, vector_data_8], + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", + [vector_data_32, vector_data_64, vector_data_8, vector_data_vb], ) # Query diff --git a/python/python-oracledb/vector_string.py b/python/python-oracledb/vector_string.py index d937f138..b929c4bc 100644 --- a/python/python-oracledb/vector_string.py +++ b/python/python-oracledb/vector_string.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2023, Oracle and/or its affiliates. +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. # # This software is dual-licensed to you under the Universal Permissive License # (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License @@ -43,11 +43,12 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) -# this script only works with Oracle Database 23.4 or later -if sample_env.get_server_version() < (23, 4): - sys.exit("This example requires Oracle Database 23.4 or later.") +# this script only works with Oracle Database 23.5 or later +if sample_env.get_server_version() < (23, 5): + sys.exit("This example requires Oracle Database 23.5 or later.") with connection.cursor() as cursor: @@ -55,29 +56,33 @@ vector1_data_32 = "[1.625, 1.5, 1.0]" vector1_data_64 = "[11.25, 11.75, 11.5]" vector1_data_8 = "[1, 2, 3]" + vector1_data_bin = "[180, 150, 100]" cursor.execute( - "insert into SampleVectorTab (v32, v64, v8) values (:1, :2, :3)", - [vector1_data_32, vector1_data_64, vector1_data_8], + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", + [vector1_data_32, vector1_data_64, vector1_data_8, vector1_data_bin], ) # Multi-row insert vector2_data_32 = "[2.625, 2.5, 2.0]" vector2_data_64 = "[22.25, 22.75, 22.5]" vector2_data_8 = "[4, 5, 6]" + vector2_data_bin = "[40, 15, 255]" vector3_data_32 = "[3.625, 3.5, 3.0]" vector3_data_64 = "[33.25, 33.75, 33.5]" vector3_data_8 = "[7, 8, 9]" + vector3_data_bin = "[0, 17, 101]" rows = [ - (vector2_data_32, vector2_data_64, vector2_data_8), - (vector3_data_32, vector3_data_64, vector3_data_8), + (vector2_data_32, vector2_data_64, vector2_data_8, vector2_data_bin), + (vector3_data_32, vector3_data_64, vector3_data_8, vector3_data_bin), ] cursor.executemany( - """insert into SampleVectorTab (v32, v64, v8) - values (:1, :2, :3)""", + """insert into SampleVectorTab (v32, v64, v8, vbin) + values (:1, :2, :3, :4)""", rows, ) diff --git a/python/python-oracledb/write_csv.py b/python/python-oracledb/write_csv.py index 2eb58287..dcefcb1d 100644 --- a/python/python-oracledb/write_csv.py +++ b/python/python-oracledb/write_csv.py @@ -45,6 +45,7 @@ user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: diff --git a/python/python-oracledb/write_csv_async.py b/python/python-oracledb/write_csv_async.py index 1f4c1245..e0b8d797 100644 --- a/python/python-oracledb/write_csv_async.py +++ b/python/python-oracledb/write_csv_async.py @@ -45,6 +45,7 @@ async def main(): user=sample_env.get_main_user(), password=sample_env.get_main_password(), dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), ) with connection.cursor() as cursor: From 2512624b39625776b942945fc88b51a4737841f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:06:17 -0800 Subject: [PATCH 11/37] Bump path-to-regexp and express (#411) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12) Updates `express` from 4.21.1 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../hr_app_streaming/package-lock.json | 44 +++++++++---------- .../hr_app_streaming/package.json | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/javascript/files-up-and-down/hr_app_streaming/package-lock.json b/javascript/files-up-and-down/hr_app_streaming/package-lock.json index e13a702d..a365410b 100644 --- a/javascript/files-up-and-down/hr_app_streaming/package-lock.json +++ b/javascript/files-up-and-down/hr_app_streaming/package-lock.json @@ -169,9 +169,9 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -192,7 +192,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -278,12 +278,9 @@ } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-property-descriptors": { "version": "1.0.2", @@ -294,14 +291,17 @@ } }, "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.1.0.tgz", + "integrity": "sha512-QLdzI9IIO1Jg7f9GT1gXpPpXArAn6cS31R1eEZqz08Gc+uQ8/XiqHWt17Fiw+2p6oTTIq5GXEpQkAlA88YRl/Q==", + "requires": { + "call-bind": "^1.0.7" + } }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "hasown": { "version": "2.0.2", @@ -404,9 +404,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" }, "on-finished": { "version": "2.3.0", @@ -432,9 +432,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "proxy-addr": { "version": "2.0.7", diff --git a/javascript/files-up-and-down/hr_app_streaming/package.json b/javascript/files-up-and-down/hr_app_streaming/package.json index eb964f2b..5632fbbb 100644 --- a/javascript/files-up-and-down/hr_app_streaming/package.json +++ b/javascript/files-up-and-down/hr_app_streaming/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.21.1", + "express": "^4.21.2", "morgan": "^1.9.1", "oracledb": "^3.1.2" } From 7c8f27d0f46d98966d45333e857a0fb360cff8ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:06:55 -0800 Subject: [PATCH 12/37] Bump org.apache.kafka:kafka-clients (#410) Bumps org.apache.kafka:kafka-clients from 3.4.0 to 3.7.1. --- updated-dependencies: - dependency-name: org.apache.kafka:kafka-clients dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- txeventq/kafka-connector-example/kafka_client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/txeventq/kafka-connector-example/kafka_client/pom.xml b/txeventq/kafka-connector-example/kafka_client/pom.xml index 325c9f04..fce62ae2 100644 --- a/txeventq/kafka-connector-example/kafka_client/pom.xml +++ b/txeventq/kafka-connector-example/kafka_client/pom.xml @@ -23,7 +23,7 @@ org.apache.kafka kafka-clients - 3.4.0 + 3.7.1 From 5740e22e459026e9b0c9de0d238cef3266dd1bb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:07:31 -0800 Subject: [PATCH 13/37] Bump cookie and express (#406) Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `cookie` from 0.6.0 to 0.7.1 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1) Updates `express` from 4.19.2 to 4.21.1 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.1) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app_buffering/package-lock.json | 99 ++++++++++--------- .../hr_app_buffering/package.json | 2 +- 2 files changed, 53 insertions(+), 48 deletions(-) diff --git a/javascript/files-up-and-down/hr_app_buffering/package-lock.json b/javascript/files-up-and-down/hr_app_buffering/package-lock.json index af679121..e13a702d 100644 --- a/javascript/files-up-and-down/hr_app_buffering/package-lock.json +++ b/javascript/files-up-and-down/hr_app_buffering/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -98,9 +98,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookie-signature": { "version": "1.0.6", @@ -141,9 +141,9 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { "version": "1.0.0", @@ -169,36 +169,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -227,12 +227,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -354,9 +354,9 @@ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -404,9 +404,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "on-finished": { "version": "2.3.0", @@ -432,9 +432,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "proxy-addr": { "version": "2.0.7", @@ -446,11 +446,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -480,9 +480,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -504,6 +504,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -520,14 +525,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { diff --git a/javascript/files-up-and-down/hr_app_buffering/package.json b/javascript/files-up-and-down/hr_app_buffering/package.json index 59db3e7b..eb964f2b 100644 --- a/javascript/files-up-and-down/hr_app_buffering/package.json +++ b/javascript/files-up-and-down/hr_app_buffering/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.1", "morgan": "^1.9.1", "oracledb": "^3.1.2" } From c85d3bd251c56d7cb46caa3da706250379e5bb23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:08:20 -0800 Subject: [PATCH 14/37] Bump path-to-regexp and express (#413) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.7 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.7...v0.1.12) Updates `express` from 4.19.2 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 242 ++++++++++++------ .../hr_app/package.json | 2 +- 2 files changed, 158 insertions(+), 86 deletions(-) diff --git a/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package-lock.json b/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package-lock.json index 221ccad5..d40203d2 100644 --- a/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package-lock.json +++ b/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -61,15 +61,32 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "requires": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", + "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", + "requires": { + "call-bind": "^1.0.8", + "get-intrinsic": "^1.2.5" } }, "content-disposition": { @@ -93,9 +110,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookie-signature": { "version": "1.0.6", @@ -130,29 +147,44 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { - "get-intrinsic": "^1.2.4" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" }, "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "requires": { + "es-errors": "^1.3.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -164,36 +196,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -217,12 +249,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -256,24 +288,26 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-property-descriptors": { "version": "1.0.2", @@ -283,15 +317,10 @@ "es-define-property": "^1.0.0" } }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" - }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "hasown": { "version": "2.0.2", @@ -331,15 +360,20 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -394,9 +428,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" }, "on-finished": { "version": "2.3.0", @@ -422,9 +456,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "proxy-addr": { "version": "2.0.7", @@ -436,11 +470,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -470,9 +504,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -489,6 +523,11 @@ "statuses": "2.0.1" }, "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -505,14 +544,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { @@ -534,14 +573,47 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "requires": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "statuses": { diff --git a/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package.json b/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package.json index 2761109c..136a672d 100644 --- a/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package.json +++ b/javascript/rest-api/part-4-handling-post-put-and-delete-requests/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.2", "morgan": "^1.10.0", "oracledb": "^5.1.0" } From 1576b2ba1d58b9c1f228bc72dcee8a7af25c0372 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:09:19 -0800 Subject: [PATCH 15/37] Bump cookie and express (#412) Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.1 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `cookie` from 0.6.0 to 0.7.1 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](https://github.com/jshttp/cookie/compare/v0.6.0...v0.7.1) Updates `express` from 4.19.2 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.2) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 242 ++++++++++++------ .../hr_app/package.json | 2 +- 2 files changed, 158 insertions(+), 86 deletions(-) diff --git a/javascript/rest-api/part-3-handling-get-requests/hr_app/package-lock.json b/javascript/rest-api/part-3-handling-get-requests/hr_app/package-lock.json index 221ccad5..d40203d2 100644 --- a/javascript/rest-api/part-3-handling-get-requests/hr_app/package-lock.json +++ b/javascript/rest-api/part-3-handling-get-requests/hr_app/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -61,15 +61,32 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "requires": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", + "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", + "requires": { + "call-bind": "^1.0.8", + "get-intrinsic": "^1.2.5" } }, "content-disposition": { @@ -93,9 +110,9 @@ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" }, "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "cookie-signature": { "version": "1.0.6", @@ -130,29 +147,44 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { - "get-intrinsic": "^1.2.4" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" }, "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "requires": { + "es-errors": "^1.3.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -164,36 +196,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -217,12 +249,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -256,24 +288,26 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-property-descriptors": { "version": "1.0.2", @@ -283,15 +317,10 @@ "es-define-property": "^1.0.0" } }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" - }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "hasown": { "version": "2.0.2", @@ -331,15 +360,20 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -394,9 +428,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" }, "on-finished": { "version": "2.3.0", @@ -422,9 +456,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "proxy-addr": { "version": "2.0.7", @@ -436,11 +470,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "range-parser": { @@ -470,9 +504,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -489,6 +523,11 @@ "statuses": "2.0.1" }, "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -505,14 +544,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { @@ -534,14 +573,47 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "requires": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "statuses": { diff --git a/javascript/rest-api/part-3-handling-get-requests/hr_app/package.json b/javascript/rest-api/part-3-handling-get-requests/hr_app/package.json index 2761109c..136a672d 100644 --- a/javascript/rest-api/part-3-handling-get-requests/hr_app/package.json +++ b/javascript/rest-api/part-3-handling-get-requests/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.2", "morgan": "^1.10.0", "oracledb": "^5.1.0" } From 91f6afd2e1a998d943380a62eac9539f95839584 Mon Sep 17 00:00:00 2001 From: Juarez Barbosa Junior Date: Thu, 12 Dec 2024 17:10:01 +0000 Subject: [PATCH 16/37] adjusted to 23ai as requested (#405) * Code sample - 23c JDBC Docker Windows * additional adjustments * fix indentation and close JDBC resources * adjusted to 23ai as requested --------- Co-authored-by: Gerald Venzl --- java/{java-jdbc-db23cfree-dev => java-jdbc-db23ai-free}/pom.xml | 2 +- .../src/main/java/com/oracle/dev/jdbc/App.java | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename java/{java-jdbc-db23cfree-dev => java-jdbc-db23ai-free}/pom.xml (96%) rename java/{java-jdbc-db23cfree-dev => java-jdbc-db23ai-free}/src/main/java/com/oracle/dev/jdbc/App.java (100%) diff --git a/java/java-jdbc-db23cfree-dev/pom.xml b/java/java-jdbc-db23ai-free/pom.xml similarity index 96% rename from java/java-jdbc-db23cfree-dev/pom.xml rename to java/java-jdbc-db23ai-free/pom.xml index b6d053ee..4b42523a 100644 --- a/java/java-jdbc-db23cfree-dev/pom.xml +++ b/java/java-jdbc-db23ai-free/pom.xml @@ -10,7 +10,7 @@ 1.0-SNAPSHOT java-jdbc-db23cfree-dev - Oracle Database 23c Free — Developer Release for Java Developers + Oracle Database 23ai Free for Java Developers with Docker on Windows https://medium.com/oracledevs/oracle-database-23c-free-developer-release-for-java-developers-with-docker-on-windows-b164a7a61a91 diff --git a/java/java-jdbc-db23cfree-dev/src/main/java/com/oracle/dev/jdbc/App.java b/java/java-jdbc-db23ai-free/src/main/java/com/oracle/dev/jdbc/App.java similarity index 100% rename from java/java-jdbc-db23cfree-dev/src/main/java/com/oracle/dev/jdbc/App.java rename to java/java-jdbc-db23ai-free/src/main/java/com/oracle/dev/jdbc/App.java From ae8c984a688f0fe35d7cd8053c3a77b4f44b3418 Mon Sep 17 00:00:00 2001 From: Angeline Dhanarani Date: Thu, 12 Dec 2024 22:40:39 +0530 Subject: [PATCH 17/37] Update README.md (#408) Co-authored-by: Gerald Venzl --- sql-firewall/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql-firewall/README.md b/sql-firewall/README.md index 5beb6e98..5413c5e2 100644 --- a/sql-firewall/README.md +++ b/sql-firewall/README.md @@ -1,5 +1,5 @@ -# Oracle SQL Firewall sample demo scripts -This folder contains Oracle SQL Firewall sample demo script (demo.sql) which you can run in Oracle Database 23c Free – Developer Release. The demo script enables SQL Firewall and shows you different configurations with regards to capturing authorized SQL traffic, generating allow list and enforcement which includes blocking. -Refer to the youtube channel video on SQL Firewall incase you want to see this demo in action: https://www.youtube.com/watch?v=cnw5AB9_Z9k&ab_channel=OracleDatabaseProductManagement -Other references to sample demo flows: - https://gavinsoorma.com.au/knowledge-base/oracle-database-23c-new-feature-sql-firewall/ +# Oracle SQL Firewall samples +This folder contains Oracle SQL Firewall sample demo script (demo.sql) which you can run in Oracle Database 23ai. The demo script enables SQL Firewall and shows you different configurations with regards to capturing authorized SQL traffic, generating allow list and enforcement which includes blocking. +Refer to the youtube channel video on SQL Firewall incase you want to see this demo in action: +https://www.youtube.com/watch?v=81N23MDhYXU![image](https://github.com/user-attachments/assets/6776ad00-5dff-4fd0-8f26-64c71aef6445) + From 0f6f56f68e75b0274e0e65f1a6101c1e32032c63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:12:00 -0800 Subject: [PATCH 18/37] Bump send and express in /javascript/idcs-authentication/hr_app (#414) Bumps [send](https://github.com/pillarjs/send) to 0.19.0 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `send` from 0.18.0 to 0.19.0 - [Release notes](https://github.com/pillarjs/send/releases) - [Changelog](https://github.com/pillarjs/send/blob/master/HISTORY.md) - [Commits](https://github.com/pillarjs/send/compare/0.18.0...0.19.0) Updates `express` from 4.19.2 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.2) --- updated-dependencies: - dependency-name: send dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 242 ++++++++++++------ .../idcs-authentication/hr_app/package.json | 2 +- 2 files changed, 158 insertions(+), 86 deletions(-) diff --git a/javascript/idcs-authentication/hr_app/package-lock.json b/javascript/idcs-authentication/hr_app/package-lock.json index 2e5b150a..a4b88198 100644 --- a/javascript/idcs-authentication/hr_app/package-lock.json +++ b/javascript/idcs-authentication/hr_app/package-lock.json @@ -27,9 +27,9 @@ } }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "requires": { "bytes": "3.1.2", "content-type": "~1.0.5", @@ -39,7 +39,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -66,15 +66,32 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "requires": { + "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", + "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", + "requires": { + "call-bind": "^1.0.8", + "get-intrinsic": "^1.2.5" } }, "content-disposition": { @@ -135,29 +152,44 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "dunder-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", + "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { - "get-intrinsic": "^1.2.4" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" }, "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "requires": { + "es-errors": "^1.3.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -169,36 +201,36 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -207,9 +239,9 @@ }, "dependencies": { "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" }, "depd": { "version": "2.0.0", @@ -259,12 +291,12 @@ } }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -298,24 +330,26 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-property-descriptors": { "version": "1.0.2", @@ -325,15 +359,10 @@ "es-define-property": "^1.0.0" } }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" - }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "hasown": { "version": "2.0.2", @@ -380,15 +409,20 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" }, "methods": { "version": "1.1.2", @@ -436,9 +470,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" }, "on-finished": { "version": "2.3.0", @@ -479,9 +513,9 @@ "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==" }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "pause": { "version": "0.0.1", @@ -498,11 +532,11 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "random-bytes": { @@ -537,9 +571,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "requires": { "debug": "2.6.9", "depd": "2.0.0", @@ -561,6 +595,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -577,14 +616,14 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "set-function-length": { @@ -606,14 +645,47 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "requires": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "statuses": { diff --git a/javascript/idcs-authentication/hr_app/package.json b/javascript/idcs-authentication/hr_app/package.json index 3291590f..b3a5567b 100644 --- a/javascript/idcs-authentication/hr_app/package.json +++ b/javascript/idcs-authentication/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.19.2", + "express": "^4.21.2", "express-session": "^1.16.2", "morgan": "^1.9.1", "oracledb": "^3.1.2", From 5be0e9cd063bac8a1b6ebac2034985a856e44eb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:25:50 -0800 Subject: [PATCH 19/37] Bump path-to-regexp and express (#425) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12) Updates `express` from 4.21.1 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../hr_app_buffering/package-lock.json | 187 ++++++++++-------- .../hr_app_buffering/package.json | 2 +- 2 files changed, 107 insertions(+), 82 deletions(-) diff --git a/javascript/files-up-and-down/hr_app_buffering/package-lock.json b/javascript/files-up-and-down/hr_app_buffering/package-lock.json index e13a702d..87184e1a 100644 --- a/javascript/files-up-and-down/hr_app_buffering/package-lock.json +++ b/javascript/files-up-and-down/hr_app_buffering/package-lock.json @@ -65,16 +65,22 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, - "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "requires": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" } }, "content-disposition": { @@ -115,16 +121,6 @@ "ms": "2.0.0" } }, - "define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - } - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -135,6 +131,16 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -146,18 +152,23 @@ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { - "get-intrinsic": "^1.2.4" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" }, "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "requires": { + "es-errors": "^1.3.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -169,9 +180,9 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -192,7 +203,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -266,42 +277,31 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } - }, - "has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "requires": { - "es-define-property": "^1.0.0" - } - }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "hasown": { "version": "2.0.2", @@ -348,6 +348,11 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -404,9 +409,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" }, "on-finished": { "version": "2.3.0", @@ -432,9 +437,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "proxy-addr": { "version": "2.0.7", @@ -535,33 +540,53 @@ "send": "0.19.0" } }, - "set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "requires": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - } - }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "requires": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "statuses": { diff --git a/javascript/files-up-and-down/hr_app_buffering/package.json b/javascript/files-up-and-down/hr_app_buffering/package.json index eb964f2b..5632fbbb 100644 --- a/javascript/files-up-and-down/hr_app_buffering/package.json +++ b/javascript/files-up-and-down/hr_app_buffering/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.21.1", + "express": "^4.21.2", "morgan": "^1.9.1", "oracledb": "^3.1.2" } From b9834d6f16bf75830903fee57a8175c3000d41a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:30:39 -0800 Subject: [PATCH 20/37] Bump path-to-regexp and express (#426) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12) Updates `express` from 4.21.1 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../hr_app/package-lock.json | 187 ++++++++++-------- .../hr_app/package.json | 2 +- 2 files changed, 107 insertions(+), 82 deletions(-) diff --git a/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json b/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json index 00beabb2..ca9567d8 100644 --- a/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json +++ b/javascript/rest-api/part-2-database-basics/hr_app/package-lock.json @@ -60,16 +60,22 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, - "call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", "requires": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" } }, "content-disposition": { @@ -110,16 +116,6 @@ "ms": "2.0.0" } }, - "define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "requires": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - } - }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -130,6 +126,16 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -141,18 +147,23 @@ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" }, "es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { - "get-intrinsic": "^1.2.4" - } + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" }, "es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" }, + "es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "requires": { + "es-errors": "^1.3.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -164,9 +175,9 @@ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, "express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -187,7 +198,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -256,42 +267,31 @@ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", + "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", "requires": { + "call-bind-apply-helpers": "^1.0.1", + "dunder-proto": "^1.0.0", + "es-define-property": "^1.0.1", "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.0.0" } }, "gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { - "get-intrinsic": "^1.1.3" - } - }, - "has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "requires": { - "es-define-property": "^1.0.0" - } - }, - "has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" }, "has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" }, "hasown": { "version": "2.0.2", @@ -331,6 +331,11 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" }, + "math-intrinsics": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==" + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -394,9 +399,9 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" }, "object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" }, "on-finished": { "version": "2.3.0", @@ -422,9 +427,9 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, "proxy-addr": { "version": "2.0.7", @@ -520,33 +525,53 @@ "send": "0.19.0" } }, - "set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "requires": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - } - }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, "side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "requires": { - "call-bind": "^1.0.7", + "call-bound": "^1.0.2", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" } }, "statuses": { diff --git a/javascript/rest-api/part-2-database-basics/hr_app/package.json b/javascript/rest-api/part-2-database-basics/hr_app/package.json index 5427eacf..136a672d 100644 --- a/javascript/rest-api/part-2-database-basics/hr_app/package.json +++ b/javascript/rest-api/part-2-database-basics/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.21.1", + "express": "^4.21.2", "morgan": "^1.10.0", "oracledb": "^5.1.0" } From 0e1bbf528a085558b48a549e61c478bef95f6dee Mon Sep 17 00:00:00 2001 From: Juarez Barbosa Junior Date: Fri, 31 Jan 2025 16:23:50 +0000 Subject: [PATCH 21/37] Code sample - 23c with Spring Data JDBC (#314) * Code sample - 23c with Spring Data JDBC * additional adjustments * fixed indentation * updated to 23ai as requested * updated to 23ai + driver 23.6.0.24.10 as requested, updated to ucp17 --- java/23ai-springboot3-jdbc/README.md | 1 + java/23ai-springboot3-jdbc/pom.xml | 71 +++++++++++ .../23ai-springboot3-jdbc/script/EMPLOYEE.SQL | 28 +++++ .../oracle/dev/springdata/jdbc/Employee.java | 115 ++++++++++++++++++ .../springdata/jdbc/EmployeeApplication.java | 34 ++++++ .../springdata/jdbc/EmployeeController.java | 76 ++++++++++++ .../jdbc/EmployeeNotFoundAdvice.java | 39 ++++++ .../jdbc/EmployeeNotFoundException.java | 31 +++++ .../springdata/jdbc/EmployeeRepository.java | 39 ++++++ .../src/main/resources/application.properties | 15 +++ 10 files changed, 449 insertions(+) create mode 100644 java/23ai-springboot3-jdbc/README.md create mode 100644 java/23ai-springboot3-jdbc/pom.xml create mode 100644 java/23ai-springboot3-jdbc/script/EMPLOYEE.SQL create mode 100644 java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/Employee.java create mode 100644 java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeApplication.java create mode 100644 java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeController.java create mode 100644 java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundAdvice.java create mode 100644 java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundException.java create mode 100644 java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeRepository.java create mode 100644 java/23ai-springboot3-jdbc/src/main/resources/application.properties diff --git a/java/23ai-springboot3-jdbc/README.md b/java/23ai-springboot3-jdbc/README.md new file mode 100644 index 00000000..71d3519f --- /dev/null +++ b/java/23ai-springboot3-jdbc/README.md @@ -0,0 +1 @@ +[Spring Data JDBC with the Oracle Database for Java Developers - Getting Started Guide](https://medium.com/oracledevs/spring-data-jdbc-with-the-oracle-database-23c-for-java-developers-getting-started-guide-1c4640fc8d27) diff --git a/java/23ai-springboot3-jdbc/pom.xml b/java/23ai-springboot3-jdbc/pom.xml new file mode 100644 index 00000000..1b6f5f55 --- /dev/null +++ b/java/23ai-springboot3-jdbc/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.2.0 + + + com.oracle.dev.springdata.jdbc + 23ai-springboot3-jdbc + 0.0.1-SNAPSHOT + 23ai-springboot3-jdbc + + 21 + + + + com.oracle.database.jdbc + ojdbc11 + 23.6.0.24.10 + + + com.oracle.database.jdbc + ucp17 + 23.6.0.24.10 + + + + org.springframework.boot + spring-boot-starter-data-jdbc + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + maven-compiler-plugin + + + + + + + + + diff --git a/java/23ai-springboot3-jdbc/script/EMPLOYEE.SQL b/java/23ai-springboot3-jdbc/script/EMPLOYEE.SQL new file mode 100644 index 00000000..edd9ff31 --- /dev/null +++ b/java/23ai-springboot3-jdbc/script/EMPLOYEE.SQL @@ -0,0 +1,28 @@ +CREATE USER ORACLE_23C_USER IDENTIFIED BY ; +GRANT DB_DEVELOPER_ROLE TO ORACLE_23C_USER; +GRANT CREATE SESSION TO ORACLE_23C_USER; +GRANT UNLIMITED TABLESPACE TO ORACLE_23C_USER; + +CREATE TABLE Employee + (id NUMBER(10) CONSTRAINT pk_employee PRIMARY KEY, + name VARCHAR2(20), + job VARCHAR2(20), + salary NUMBER(10), + commission NUMBER(10)); + +INSERT INTO Employee VALUES(7369,'JOHN','CLERK',7902,NULL); +INSERT INTO Employee VALUES(7499,'PETER','SALESMAN',7698,300); +INSERT INTO Employee VALUES(7521,'JEFF','SALESMAN',7698,500); +INSERT INTO Employee VALUES(7566,'MARK','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7654,'MARTIN','SALESMAN',7698,1400); +INSERT INTO Employee VALUES(7698,'ADAM','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7782,'CLARK','MANAGER',7839,NULL); +INSERT INTO Employee VALUES(7788,'SCOTT','ANALYST',7566,NULL); +INSERT INTO Employee VALUES(7839,'KING','PRESIDENT',NULL); +INSERT INTO Employee VALUES(7844,'TURNER','SALESMAN',0); +INSERT INTO Employee VALUES(7876,'ADAMS','CLERK',7788,NULL); +INSERT INTO Employee VALUES(7900,'JAMES','CLERK',7698,NULL); +INSERT INTO Employee VALUES(7902,'FORD','ANALYST',7566,NULL); +INSERT INTO Employee VALUES(7934,'MILLER','CLERK',7782,NULL); + +COMMIT; \ No newline at end of file diff --git a/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/Employee.java b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/Employee.java new file mode 100644 index 00000000..eca7c9fa --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/Employee.java @@ -0,0 +1,115 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.springdata.jdbc; + +import java.util.Objects; + +import org.springframework.data.annotation.Id; +import org.springframework.data.relational.core.mapping.Table; + +@Table +public class Employee { + + private @Id Long id; + private String name; + private String job; + private Integer salary; + private Integer commission; + + public Employee() { + } + + public Employee(Long id, String name, String job, Integer salary, + Integer commission) { + this.id = id; + this.name = name; + this.job = job; + this.salary = salary; + this.commission = commission; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getJob() { + return job; + } + + public void setJob(String job) { + this.job = job; + } + + public Integer getSalary() { + return salary; + } + + public void setSalary(Integer salary) { + this.salary = salary; + } + + public Integer getCommission() { + return commission; + } + + public void setCommission(Integer commission) { + this.commission = commission; + } + + @Override + public int hashCode() { + return Objects.hash(commission, id, job, name, salary); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Employee other = (Employee) obj; + return Objects.equals(commission, other.commission) + && Objects.equals(id, other.id) && Objects.equals(job, other.job) + && Objects.equals(name, other.name) + && Objects.equals(salary, other.salary); + } + + public String toString() { + return String.format("%20s %20s %20s %20s %20s", id, name, job, salary, + commission); + + } +} diff --git a/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeApplication.java b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeApplication.java new file mode 100644 index 00000000..a3f05d61 --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeApplication.java @@ -0,0 +1,34 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.springdata.jdbc; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class EmployeeApplication { + + public static void main(String[] args) { + SpringApplication.run(EmployeeApplication.class, args); + } + +} diff --git a/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeController.java b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeController.java new file mode 100644 index 00000000..a3f62a93 --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeController.java @@ -0,0 +1,76 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.springdata.jdbc; + +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +class EmployeeController { + + private final EmployeeRepository repository; + + EmployeeController(EmployeeRepository repository) { + this.repository = repository; + } + + @GetMapping("/employees") + Iterable all() { + return repository.findAll(); + } + + @PostMapping("/employees") + Employee newEmployee(@RequestBody Employee newEmployee) { + return repository.save(newEmployee); + } + + @GetMapping("/employees/{id}") + Employee one(@PathVariable Long id) { + + return repository.findById(id) + .orElseThrow(() -> new EmployeeNotFoundException(id)); + } + + @PutMapping("/employees/{id}") + Employee replaceEmployee(@RequestBody Employee newEmployee, + @PathVariable Long id) { + + return repository.findById(id).map(employee -> { + employee.setName(newEmployee.getName()); + employee.setJob(newEmployee.getJob()); + return repository.save(employee); + }).orElseGet(() -> { + newEmployee.setId(id); + return repository.save(newEmployee); + }); + } + + @DeleteMapping("/employees/{id}") + void deleteEmployee(@PathVariable Long id) { + repository.deleteById(id); + } +} \ No newline at end of file diff --git a/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundAdvice.java b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundAdvice.java new file mode 100644 index 00000000..28b5090b --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundAdvice.java @@ -0,0 +1,39 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.springdata.jdbc; + +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +@ControllerAdvice +class EmployeeNotFoundAdvice { + + @ResponseBody + @ExceptionHandler(EmployeeNotFoundException.class) + @ResponseStatus(HttpStatus.NOT_FOUND) + String employeeNotFoundHandler(EmployeeNotFoundException ex) { + return ex.getMessage(); + } +} \ No newline at end of file diff --git a/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundException.java b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundException.java new file mode 100644 index 00000000..25c64567 --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeNotFoundException.java @@ -0,0 +1,31 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.springdata.jdbc; + +class EmployeeNotFoundException extends RuntimeException { + + private static final long serialVersionUID = 7768215094663842819L; + + EmployeeNotFoundException(Long id) { + super("Could not find employee " + id); + } +} \ No newline at end of file diff --git a/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeRepository.java b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeRepository.java new file mode 100644 index 00000000..fce67dc3 --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/java/com/oracle/dev/springdata/jdbc/EmployeeRepository.java @@ -0,0 +1,39 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.dev.springdata.jdbc; + +import java.util.List; + +import org.springframework.data.jdbc.repository.query.Modifying; +import org.springframework.data.jdbc.repository.query.Query; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.query.Param; + +interface EmployeeRepository extends CrudRepository { + + List findByName(String name); + + @Modifying + @Query("UPDATE employee SET name = :name WHERE id = :id") + boolean updateByName(@Param("id") Long id, @Param("name") String name); + +} \ No newline at end of file diff --git a/java/23ai-springboot3-jdbc/src/main/resources/application.properties b/java/23ai-springboot3-jdbc/src/main/resources/application.properties new file mode 100644 index 00000000..41d447b2 --- /dev/null +++ b/java/23ai-springboot3-jdbc/src/main/resources/application.properties @@ -0,0 +1,15 @@ +# https://www.oracle.com/database/technologies/getting-started-using-jdbc.html + +# Oracle Database 23ai Free - DB instance details +# JDBC URL EXAMPLE = jdbc:oracle:thin:@:/ +spring.datasource.url= +spring.datasource.username= +spring.datasource.password= + +# Properties for UCP - Universal Connection Pool (UCP). Spring Boot 2.4.0 or above is required +spring.datasource.type=oracle.ucp.jdbc.PoolDataSource +spring.datasource.oracleucp.connection-pool-name=connectionPoolName1 +spring.datasource.oracleucp.initial-pool-size=1 +spring.datasource.oracleucp.min-pool-size=1 +spring.datasource.oracleucp.max-pool-size=2 +spring.datasource.oracleucp.connection-factory-class-name=oracle.jdbc.pool.OracleDataSource From a3aad92c4b2cf94f306257cb44415db047131a48 Mon Sep 17 00:00:00 2001 From: Alex Blyth Date: Wed, 5 Feb 2025 04:49:36 +1100 Subject: [PATCH 22/37] udpate broken doc link (#431) --- exadata/insight/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/exadata/insight/README.md b/exadata/insight/README.md index a67570bb..e0344e60 100644 --- a/exadata/insight/README.md +++ b/exadata/insight/README.md @@ -11,29 +11,25 @@ Real-time insight provides infrastructure to: - **Stream** fine-grained metric observations to user-defined locations in real-time, using either push (upload) or pull (download) transmission models - **Integrate** Exadata metrics with popular observability platforms, time-series databases, and visualization applications - ## Get started - [Exadata 22.1 Software Release](https://docs.oracle.com/en/engineered-systems/exadata-database-machine/dbmso/new-features.html) -- [Monitoring Exadata](https://docs.oracle.com/en/engineered-systems/exadata-database-machine/sagug/exadata-storage-server-monitoring.html) - +- [Monitoring Exadata](https://docs.oracle.com/en/engineered-systems/exadata-database-machine/sagug/monitoring-exadata1.html) ## Documentation You can find the online documentation of Oracle Exadata under [docs.oracle.com/en/engineered-systems/exadata-database-machine/](https://docs.oracle.com/en/engineered-systems/exadata-database-machine) - ## Contributing If you're interested in contributing to the Oracle Exadata demo project: - Start by reading the [Contributing guide](https://github.com/oracle-samples/oracle-db-examples/blob/main/CONTRIBUTING.md). - ## Get Involved -You can get involved with Exadata. +You can get involved with Exadata. - Reach out to the [ExadataPM](https://twitter.com/ExadataPM) team on twitter: - [@Alex_Blyth](https://twitter.com/alex_blyth) From 9a95baf0f2a61bd50b656f2f2cbb39eea5581988 Mon Sep 17 00:00:00 2001 From: Alex Blyth Date: Thu, 6 Feb 2025 02:23:32 +1100 Subject: [PATCH 23/37] update links to docs and Bluesky (#432) --- exadata/README.md | 7 +++---- exadata/insight/README.md | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/exadata/README.md b/exadata/README.md index ecf1bc45..c732593d 100644 --- a/exadata/README.md +++ b/exadata/README.md @@ -11,7 +11,7 @@ This directory includes the supplemental materials and demo contents for Oracle ## Get started - [Exadata Software What's New](https://docs.oracle.com/en/engineered-systems/exadata-database-machine/dbmso/new-features.html) -- [Monitoring Exadata](https://docs.oracle.com/en/engineered-systems/exadata-database-machine/sagug/exadata-storage-server-monitoring.html) +- [Monitoring Exadata](https://docs.oracle.com/en/engineered-systems/exadata-database-machine/sagug/monitoring-exadata1.html) ## Documentation @@ -27,9 +27,8 @@ If you're interested in contributing to the Oracle Exadata demo project: You can get involved with Exadata. -- Reach out to the [ExadataPM](https://twitter.com/ExadataPM) team on twitter: - - - [@Alex_Blyth](https://twitter.com/alex_blyth) +- Reach out to the [ExadataPM](https://bsky.app/profile/exadata.bsky.social) team on Bluesky: + - [@Alex_Blyth](https://bsky.app/profile/alexblyth.net) - [@Seth_M_Miller](https://twitter.com/Seth_M_Miller) - Read and subscribe to the [Exadata Product Management blog](https://blogs.oracle.com/exadata/) - Check out the updated technical pages for [Exadata](https://www.oracle.com/database/technologies/exadata) diff --git a/exadata/insight/README.md b/exadata/insight/README.md index e0344e60..d47131c9 100644 --- a/exadata/insight/README.md +++ b/exadata/insight/README.md @@ -31,8 +31,8 @@ If you're interested in contributing to the Oracle Exadata demo project: You can get involved with Exadata. -- Reach out to the [ExadataPM](https://twitter.com/ExadataPM) team on twitter: - - [@Alex_Blyth](https://twitter.com/alex_blyth) +- Reach out to the [ExadataPM](https://bsky.app/profile/exadata.bsky.social) team on Bluesky: + - [@Alex_Blyth](https://bsky.app/profile/alexblyth.net) - [@Seth_M_Miller](https://twitter.com/Seth_M_Miller) - Read and subscribe to the [Exadata Product Management blog](https://blogs.oracle.com/exadata/) - Check out the updated technical pages for [Exadata](https://www.oracle.com/database/technologies/exadata) From e801ae1484d9bc532ba4208725ce6568d97babdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:26:24 -0800 Subject: [PATCH 24/37] Bump ch.qos.logback:logback-core in /sagas/CloudBank-DEMO (#427) Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.4.12 to 1.5.13. - [Commits](https://github.com/qos-ch/logback/compare/v_1.4.12...v_1.5.13) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- sagas/CloudBank-DEMO/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sagas/CloudBank-DEMO/pom.xml b/sagas/CloudBank-DEMO/pom.xml index 9a767bb7..bcd775f3 100644 --- a/sagas/CloudBank-DEMO/pom.xml +++ b/sagas/CloudBank-DEMO/pom.xml @@ -65,7 +65,7 @@ ch.qos.logback logback-core - 1.4.12 + 1.5.13 ch.qos.logback From fe980295be8ebd0d21bfb5c70905d59007d461df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:37:32 -0800 Subject: [PATCH 25/37] Bump cookie and express-session (#429) Bumps [cookie](https://github.com/jshttp/cookie) to 0.7.2 and updates ancestor dependency [express-session](https://github.com/expressjs/session). These dependencies need to be updated together. Updates `cookie` from 0.3.1 to 0.7.2 - [Release notes](https://github.com/jshttp/cookie/releases) - [Commits](https://github.com/jshttp/cookie/compare/v0.3.1...v0.7.2) Updates `express-session` from 1.16.2 to 1.18.1 - [Release notes](https://github.com/expressjs/session/releases) - [Changelog](https://github.com/expressjs/session/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/session/compare/v1.16.2...v1.18.1) --- updated-dependencies: - dependency-name: cookie dependency-type: indirect - dependency-name: express-session dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../hr_app/package-lock.json | 832 ++++++++++++------ .../idcs-authentication/hr_app/package.json | 2 +- 2 files changed, 585 insertions(+), 249 deletions(-) diff --git a/javascript/idcs-authentication/hr_app/package-lock.json b/javascript/idcs-authentication/hr_app/package-lock.json index a4b88198..16839840 100644 --- a/javascript/idcs-authentication/hr_app/package-lock.json +++ b/javascript/idcs-authentication/hr_app/package-lock.json @@ -1,36 +1,53 @@ { "name": "hr_app", "version": "0.1.0", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "accepts": { + "packages": { + "": { + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "express": "^4.21.2", + "express-session": "^1.18.1", + "morgan": "^1.9.1", + "oracledb": "^3.1.2", + "passport": "^0.6.0" + } + }, + "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { + "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" } }, - "array-flatten": { + "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, - "basic-auth": { + "node_modules/basic-auth": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "requires": { + "dependencies": { "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" } }, - "body-parser": { + "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "requires": { + "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", @@ -44,167 +61,246 @@ "type-is": "~1.6.18", "unpipe": "1.0.0" }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "bytes": { + "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } }, - "call-bind": { + "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", - "requires": { + "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "call-bind-apply-helpers": { + "node_modules/call-bind-apply-helpers": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "requires": { + "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, - "call-bound": { + "node_modules/call-bound": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz", "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==", - "requires": { + "dependencies": { "call-bind": "^1.0.8", "get-intrinsic": "^1.2.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "content-disposition": { + "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { + "dependencies": { "safe-buffer": "5.2.1" }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - } + "engines": { + "node": ">= 0.6" } }, - "content-type": { + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } }, - "cookie": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "cookie-signature": { + "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "debug": { + "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { + "dependencies": { "ms": "2.0.0" } }, - "define-data-property": { + "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "depd": { + "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } }, - "destroy": { + "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, - "dunder-proto": { + "node_modules/dunder-proto": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz", "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==", - "requires": { + "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" } }, - "ee-first": { + "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "encodeurl": { + "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } }, - "es-define-property": { + "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==" + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "engines": { + "node": ">= 0.4" + } }, - "es-errors": { + "node_modules/es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } }, - "es-object-atoms": { + "node_modules/es-object-atoms": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "requires": { + "dependencies": { "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" } }, - "escape-html": { + "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "etag": { + "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } }, - "express": { + "node_modules/express": { "version": "4.21.2", "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "requires": { + "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", @@ -237,64 +333,118 @@ "utils-merge": "1.0.1", "vary": "~1.1.2" }, - "dependencies": { - "cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" - }, - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - } + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "express-session": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.16.2.tgz", - "integrity": "sha512-oy0sRsdw6n93E9wpCNWKRnSsxYnSDX9Dnr9mhZgqUEEorzcq5nshGYSZ4ZReHFhKQ80WI5iVUUSPW7u3GaKauw==", - "requires": { - "cookie": "0.3.1", - "cookie-signature": "1.0.6", + "node_modules/express-session": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.1.tgz", + "integrity": "sha512-a5mtTqEaZvBCL9A9aqkrtfz+3SMDhOVUnjafjo+s7A9Txkq+SVX2DLvSp1Zrv4uCXa3lMSK3viWnh9Gg07PBUA==", + "license": "MIT", + "dependencies": { + "cookie": "0.7.2", + "cookie-signature": "1.0.7", "debug": "2.6.9", "depd": "~2.0.0", "on-headers": "~1.0.2", "parseurl": "~1.3.3", - "safe-buffer": "5.1.2", + "safe-buffer": "5.2.1", "uid-safe": "~2.1.5" }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/express-session/node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/express-session/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express-session/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } + ], + "license": "MIT" + }, + "node_modules/express/node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "engines": { + "node": ">= 0.6" } }, - "finalhandler": { + "node_modules/express/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/finalhandler": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "requires": { + "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", @@ -303,37 +453,50 @@ "statuses": "2.0.1", "unpipe": "~1.0.0" }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "forwarded": { + "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } }, - "fresh": { + "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } }, - "function-bind": { + "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "get-intrinsic": { + "node_modules/get-intrinsic": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz", "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==", - "requires": { + "dependencies": { "call-bind-apply-helpers": "^1.0.1", "dunder-proto": "^1.0.0", "es-define-property": "^1.0.1", @@ -344,237 +507,349 @@ "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "gopd": { + "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==" + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "has-property-descriptors": { + "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-symbols": { + "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==" + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "hasown": { + "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "requires": { + "dependencies": { "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, - "http-errors": { + "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "requires": { + "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } + "engines": { + "node": ">= 0.8" } }, - "iconv-lite": { + "node_modules/http-errors/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ipaddr.js": { + "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } }, - "math-intrinsics": { + "node_modules/math-intrinsics": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz", - "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==" + "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==", + "engines": { + "node": ">= 0.4" + } }, - "media-typer": { + "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } }, - "merge-descriptors": { + "node_modules/merge-descriptors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "methods": { + "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } }, - "mime": { + "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } }, - "mime-db": { + "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } }, - "mime-types": { + "node_modules/mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { + "dependencies": { "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" } }, - "morgan": { + "node_modules/morgan": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", - "requires": { + "dependencies": { "basic-auth": "~2.0.0", "debug": "2.6.9", "depd": "~1.1.2", "on-finished": "~2.3.0", "on-headers": "~1.0.1" + }, + "engines": { + "node": ">= 0.8.0" } }, - "ms": { + "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "negotiator": { + "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } }, - "object-inspect": { + "node_modules/object-inspect": { "version": "1.13.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==" + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "on-finished": { + "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { + "dependencies": { "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "on-headers": { + "node_modules/on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "engines": { + "node": ">= 0.8" + } }, - "oracledb": { + "node_modules/oracledb": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/oracledb/-/oracledb-3.1.2.tgz", - "integrity": "sha512-DOBKpUlfvGAX6bcpuPGtPVVfOOUqFue8eLjbnnmkDyBTU+YuH+gXHRy4ftlFzkHBXYkrSGenFJrXy8dDfEVXCg==" + "integrity": "sha512-DOBKpUlfvGAX6bcpuPGtPVVfOOUqFue8eLjbnnmkDyBTU+YuH+gXHRy4ftlFzkHBXYkrSGenFJrXy8dDfEVXCg==", + "deprecated": "Update to node-oracledb 5", + "hasInstallScript": true, + "engines": { + "node": ">=6" + } }, - "parseurl": { + "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } }, - "passport": { + "node_modules/passport": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/passport/-/passport-0.6.0.tgz", "integrity": "sha512-0fe+p3ZnrWRW74fe8+SvCyf4a3Pb2/h7gFkQ8yTJpAO50gDzlfjZUZTO1k5Eg9kUct22OxHLqDZoKUWRHOh9ug==", - "requires": { + "dependencies": { "passport-strategy": "1.x.x", "pause": "0.0.1", "utils-merge": "^1.0.1" + }, + "engines": { + "node": ">= 0.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jaredhanson" } }, - "passport-strategy": { + "node_modules/passport-strategy": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", - "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==" + "integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==", + "engines": { + "node": ">= 0.4.0" + } }, - "path-to-regexp": { + "node_modules/path-to-regexp": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==" }, - "pause": { + "node_modules/pause": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" }, - "proxy-addr": { + "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { + "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" } }, - "qs": { + "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "requires": { + "dependencies": { "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "random-bytes": { + "node_modules/random-bytes": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", - "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=", + "engines": { + "node": ">= 0.8" + } }, - "range-parser": { + "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } }, - "raw-body": { + "node_modules/raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "requires": { + "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "send": { + "node_modules/send": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "requires": { + "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -589,146 +864,207 @@ "range-parser": "~1.2.1", "statuses": "2.0.1" }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/send/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "serve-static": { + "node_modules/serve-static": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "requires": { + "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "set-function-length": { + "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "requires": { + "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" } }, - "setprototypeof": { + "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, - "side-channel": { + "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "requires": { + "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "side-channel-list": { + "node_modules/side-channel-list": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "requires": { + "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "side-channel-map": { + "node_modules/side-channel-map": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "requires": { + "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "side-channel-weakmap": { + "node_modules/side-channel-weakmap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "requires": { + "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "statuses": { + "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } }, - "toidentifier": { + "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } }, - "type-is": { + "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { + "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" } }, - "uid-safe": { + "node_modules/uid-safe": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", - "requires": { + "dependencies": { "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "unpipe": { + "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } }, - "utils-merge": { + "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "engines": { + "node": ">= 0.4.0" + } }, - "vary": { + "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } } } } diff --git a/javascript/idcs-authentication/hr_app/package.json b/javascript/idcs-authentication/hr_app/package.json index b3a5567b..9d824c27 100644 --- a/javascript/idcs-authentication/hr_app/package.json +++ b/javascript/idcs-authentication/hr_app/package.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "express": "^4.21.2", - "express-session": "^1.16.2", + "express-session": "^1.18.1", "morgan": "^1.9.1", "oracledb": "^3.1.2", "passport": "^0.6.0" From 902084d60402ec2437aba0a21c359da79ccfbb0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:38:14 -0800 Subject: [PATCH 26/37] Bump path-to-regexp and express (#430) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12) Updates `express` from 4.21.0 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.0...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 636 ++++++++++++------ .../hr_app/package.json | 2 +- 2 files changed, 443 insertions(+), 195 deletions(-) diff --git a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json index 3c1cde88..ef732983 100644 --- a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json +++ b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package-lock.json @@ -1,36 +1,51 @@ { "name": "hr_app", "version": "0.1.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "accepts": { + "packages": { + "": { + "version": "0.1.1", + "license": "Apache-2.0", + "dependencies": { + "express": "^4.21.2", + "morgan": "^1.10.0", + "oracledb": "^5.1.0" + } + }, + "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { + "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" } }, - "array-flatten": { + "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, - "basic-auth": { + "node_modules/basic-auth": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "requires": { + "dependencies": { "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" } }, - "body-parser": { + "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "requires": { + "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", @@ -44,136 +59,198 @@ "type-is": "~1.6.18", "unpipe": "1.0.0" }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "bytes": { + "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } }, - "call-bind": { + "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "content-disposition": { + "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { + "dependencies": { "safe-buffer": "5.2.1" }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - } + "engines": { + "node": ">= 0.6" } }, - "content-type": { + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } }, - "cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "cookie-signature": { + "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "debug": { + "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { + "dependencies": { "ms": "2.0.0" } }, - "define-data-property": { + "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "depd": { + "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } }, - "destroy": { + "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, - "ee-first": { + "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "encodeurl": { + "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } }, - "es-define-property": { + "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { + "dependencies": { "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" } }, - "es-errors": { + "node_modules/es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } }, - "escape-html": { + "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "etag": { + "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } }, - "express": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", - "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", - "requires": { + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.6.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", @@ -187,7 +264,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -200,27 +277,49 @@ "utils-merge": "1.0.1", "vary": "~1.1.2" }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + { + "type": "consulting", + "url": "https://feross.org/support" } - } + ] }, - "finalhandler": { + "node_modules/finalhandler": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "requires": { + "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", @@ -229,251 +328,363 @@ "statuses": "2.0.1", "unpipe": "~1.0.0" }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "forwarded": { + "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } }, - "fresh": { + "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } }, - "function-bind": { + "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "get-intrinsic": { + "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "requires": { + "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "gopd": { + "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { + "dependencies": { "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-property-descriptors": { + "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-proto": { + "node_modules/has-proto": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "has-symbols": { + "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "hasown": { + "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "requires": { + "dependencies": { "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, - "http-errors": { + "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "requires": { + "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" } }, - "iconv-lite": { + "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ipaddr.js": { + "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } }, - "media-typer": { + "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } }, - "merge-descriptors": { + "node_modules/merge-descriptors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "methods": { + "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } }, - "mime": { + "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } }, - "mime-db": { + "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } }, - "mime-types": { + "node_modules/mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { + "dependencies": { "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" } }, - "morgan": { + "node_modules/morgan": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", - "requires": { + "dependencies": { "basic-auth": "~2.0.1", "debug": "2.6.9", "depd": "~2.0.0", "on-finished": "~2.3.0", "on-headers": "~1.0.2" }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" } }, - "ms": { + "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "negotiator": { + "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } }, - "object-inspect": { + "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "on-finished": { + "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { + "dependencies": { "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "on-headers": { + "node_modules/on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "engines": { + "node": ">= 0.8" + } }, - "oracledb": { + "node_modules/oracledb": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/oracledb/-/oracledb-5.1.0.tgz", - "integrity": "sha512-/IpzG729lFj8NBsA0xaOijdf6ZO3VuJbebma/hSf+VUZoIyzI/mCzBX047ramb/W8yJ1SV/HdWgs+XEczbqsXg==" + "integrity": "sha512-/IpzG729lFj8NBsA0xaOijdf6ZO3VuJbebma/hSf+VUZoIyzI/mCzBX047ramb/W8yJ1SV/HdWgs+XEczbqsXg==", + "hasInstallScript": true, + "engines": { + "node": ">=10.16" + } }, - "parseurl": { + "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } }, - "path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" }, - "proxy-addr": { + "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { + "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" } }, - "qs": { + "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "requires": { + "dependencies": { "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "range-parser": { + "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } }, - "raw-body": { + "node_modules/raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "requires": { + "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "send": { + "node_modules/send": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "requires": { + "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -488,100 +699,137 @@ "range-parser": "~1.2.1", "statuses": "2.0.1" }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/send/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "serve-static": { + "node_modules/serve-static": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "requires": { + "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "set-function-length": { + "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "requires": { + "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" } }, - "setprototypeof": { + "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, - "side-channel": { + "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "requires": { + "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.4", "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "statuses": { + "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } }, - "toidentifier": { + "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } }, - "type-is": { + "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { + "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" } }, - "unpipe": { + "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } }, - "utils-merge": { + "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } }, - "vary": { + "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } } } } diff --git a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json index c81b3029..136a672d 100644 --- a/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json +++ b/javascript/rest-api/part-5-manual-pagination-sorting-and-filtering/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.21.0", + "express": "^4.21.2", "morgan": "^1.10.0", "oracledb": "^5.1.0" } From 2146193d8f7080a6b2289fc57e275c2dbffa06b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:39:02 -0800 Subject: [PATCH 27/37] Bump ch.qos.logback:logback-core in /sagas/SagaBenchmark (#433) Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.4.12 to 1.5.13. - [Commits](https://github.com/qos-ch/logback/compare/v_1.4.12...v_1.5.13) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- sagas/SagaBenchmark/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sagas/SagaBenchmark/pom.xml b/sagas/SagaBenchmark/pom.xml index 776b01d4..4beac37e 100644 --- a/sagas/SagaBenchmark/pom.xml +++ b/sagas/SagaBenchmark/pom.xml @@ -62,7 +62,7 @@ ch.qos.logback logback-core - 1.4.12 + 1.5.13 ch.qos.logback From 9f2b4a07feb0f8d8fc4a594a2d1564fb2e256d48 Mon Sep 17 00:00:00 2001 From: Juarez Barbosa Junior Date: Mon, 17 Mar 2025 19:10:58 +0000 Subject: [PATCH 28/37] Code sample - 23c JDBC Reactive Extensions (#317) * Code sample - 23c JDBC Reactive Extensions * code sample adjustments * code sample adjustments * code sample adjustments * changed to make the explanation release-agnostic * updated to driver 23.6.0.24.10 as requested * updated to driver 23.7.0.25.01, added Statements for DDL, added OraclePreparedStatement for DML, added new queries including select (streaming) example method, added sql file, added DB connection config.properties file --- java/jdbc-reactive-extensions-intro/pom.xml | 74 ++++++++ .../oracle/jdbc/reactive/DatabaseConfig.java | 120 ++++++++++++ .../SQLStatementWithAsynchronousJDBC.java | 178 ++++++++++++++++++ .../src/main/resources/config.properties | 7 + .../sql/jdbc-reactive-extensions-intro.sql | 33 ++++ 5 files changed, 412 insertions(+) create mode 100644 java/jdbc-reactive-extensions-intro/pom.xml create mode 100644 java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/DatabaseConfig.java create mode 100644 java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/SQLStatementWithAsynchronousJDBC.java create mode 100644 java/jdbc-reactive-extensions-intro/src/main/resources/config.properties create mode 100644 java/jdbc-reactive-extensions-intro/src/sql/jdbc-reactive-extensions-intro.sql diff --git a/java/jdbc-reactive-extensions-intro/pom.xml b/java/jdbc-reactive-extensions-intro/pom.xml new file mode 100644 index 00000000..f00a4998 --- /dev/null +++ b/java/jdbc-reactive-extensions-intro/pom.xml @@ -0,0 +1,74 @@ + + + + 4.0.0 + + com.oracle.jdbc.reactive + jdbc-reactive-extensions-intro + 1.0-SNAPSHOT + jdbc-reactive-extensions-intro + + + UTF-8 + 21 + 21 + + + + + com.oracle.database.jdbc + ojdbc17-production + 23.7.0.25.01 + pom + + + + + + + + maven-clean-plugin + 3.1.0 + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + + + diff --git a/java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/DatabaseConfig.java b/java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/DatabaseConfig.java new file mode 100644 index 00000000..9aea8534 --- /dev/null +++ b/java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/DatabaseConfig.java @@ -0,0 +1,120 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.jdbc.reactive; + +import oracle.jdbc.OracleConnection; +import oracle.jdbc.pool.OracleDataSource; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.sql.SQLException; +import java.util.Properties; + +public class DatabaseConfig { + + private static final ConfigData CONFIG_DATA = loadConfig(); + + private static ConfigData loadConfig() { + Properties properties = new Properties(); + try { + var fileStream = Files.newInputStream(Path.of("src/main/resources/config.properties")); + properties.load(fileStream); + return new ConfigData(properties.getProperty("DRIVER"), properties.getProperty("USER"), + properties.getProperty("PASSWORD"), properties.getProperty("HOST"), + Integer.parseInt(properties.getProperty("PORT")), properties.getProperty("DATABASE"), + properties.getProperty("DB_TABLE_NAME")); + } catch (IOException e) { + e.printStackTrace(); + return null; + } + } + + public static OracleDataSource getDataSource() throws SQLException { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration data is not available, check file path."); + } + OracleDataSource dataSource = new OracleDataSource(); + dataSource + .setURL("jdbc:oracle:thin:@" + CONFIG_DATA.host() + ":" + CONFIG_DATA.port() + "/" + CONFIG_DATA.database()); + dataSource.setUser(CONFIG_DATA.user()); + dataSource.setPassword(CONFIG_DATA.password()); + return dataSource; + } + + public static OracleConnection getConnection() throws SQLException { + return (OracleConnection) getDataSource().getConnection(); + } + + public static String getDbTableName() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.dbTableName(); + } + + public static String getDriver() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.driver(); + } + + public static String getUser() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.user(); + } + + public static String getPassword() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.password(); + } + + public static String getHost() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.host(); + } + + public static int getPort() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.port(); + } + + public static String getDatabase() { + if (CONFIG_DATA == null) { + throw new IllegalStateException("Configuration could not be loaded."); + } + return CONFIG_DATA.database(); + } + + private record ConfigData(String driver, String user, String password, String host, int port, String database, + String dbTableName) { + } +} \ No newline at end of file diff --git a/java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/SQLStatementWithAsynchronousJDBC.java b/java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/SQLStatementWithAsynchronousJDBC.java new file mode 100644 index 00000000..ac65d50b --- /dev/null +++ b/java/jdbc-reactive-extensions-intro/src/main/java/com/oracle/jdbc/reactive/SQLStatementWithAsynchronousJDBC.java @@ -0,0 +1,178 @@ +/* + Copyright (c) 2024, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package com.oracle.jdbc.reactive; + +import java.sql.SQLException; +import java.util.concurrent.Flow; +import java.util.concurrent.SubmissionPublisher; +import java.util.stream.IntStream; + +import oracle.jdbc.OracleConnection; +import oracle.jdbc.OraclePreparedStatement; +import oracle.jdbc.OracleResultSet; +import oracle.jdbc.OracleStatement; + +public class SQLStatementWithAsynchronousJDBC { + + public static void main(String[] args) throws InterruptedException { + SQLStatementWithAsynchronousJDBC asyncSQL = new SQLStatementWithAsynchronousJDBC(); + try (OracleConnection conn = DatabaseConfig.getConnection()) { + asyncSQL.createTable(conn); + IntStream.rangeClosed(0, 3).forEach(i -> asyncSQL.insertData(conn, i, "Java " + i, "Duke " + i)); + asyncSQL.readData(conn); + Thread.sleep(5000); + asyncSQL.dropTable(conn); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + private Flow.Publisher insertData(OracleConnection connection, int id, String firstName, String lastName) { + try { + final OraclePreparedStatement insertStatement = (OraclePreparedStatement) connection + .prepareStatement("INSERT INTO employee_names (id, first_name, last_name) VALUES (?, ?, ?)"); + insertStatement.setInt(1, id); + insertStatement.setString(2, firstName); + insertStatement.setString(3, lastName); + + Flow.Publisher insertPublisher = insertStatement.unwrap(OraclePreparedStatement.class) + .executeAsyncOracle(); + + insertPublisher.subscribe(new Flow.Subscriber() { + private Flow.Subscription subscription; + + public void onSubscribe(Flow.Subscription subscription) { + this.subscription = subscription; + subscription.request(1L); + } + + public void onNext(Boolean item) { + } + + public void onError(Throwable throwable) { + closeStatement(); + throwable.printStackTrace(); + } + + public void onComplete() { + closeStatement(); + } + + void closeStatement() { + try { + if (insertStatement != null && !insertStatement.isClosed()) { + insertStatement.close(); + } + } catch (SQLException closeException) { + closeException.printStackTrace(); + } + } + }); + + return insertPublisher; + } catch (SQLException e) { + e.printStackTrace(); + SubmissionPublisher publisher = new SubmissionPublisher<>(); + publisher.close(); + return publisher; + } + } + + public Flow.Publisher readData(OracleConnection connection) { + try { + final OraclePreparedStatement readStatement = (OraclePreparedStatement) connection + .prepareStatement("SELECT * FROM employee_names WHERE first_name LIKE ?"); + readStatement.setString(1, "Jav%"); + + Flow.Publisher readPublisher = readStatement.unwrap(OraclePreparedStatement.class) + .executeQueryAsyncOracle(); + + readPublisher.subscribe(new Flow.Subscriber() { + private Flow.Subscription subscription; + + public void onSubscribe(Flow.Subscription subscription) { + this.subscription = subscription; + subscription.request(Long.MAX_VALUE); + } + + public void onNext(OracleResultSet resultSet) { + try { + while (resultSet.next()) { + int id = resultSet.getInt("id"); + String firstName = resultSet.getString("first_name"); + String lastName = resultSet.getString("last_name"); + System.out.println("ID: " + id + ", First Name: " + firstName + ", Last Name: " + lastName); + } + System.out.println("Finished receiving stream data successfully. \nPreparing to drop table..."); + } catch (SQLException e) { + onError(e); + } + } + + public void onError(Throwable throwable) { + closeStatement(); + throwable.printStackTrace(); + } + + public void onComplete() { + closeStatement(); + } + + void closeStatement() { + try { + if (readStatement != null && !readStatement.isClosed()) { + readStatement.close(); + } + } catch (SQLException closeException) { + closeException.printStackTrace(); + } + } + }); + return readPublisher; + } catch (SQLException e) { + e.printStackTrace(); + SubmissionPublisher publisher = new SubmissionPublisher<>(); + publisher.close(); + return publisher; + } + } + + private void createTable(OracleConnection connection) { + String createTableSQL = "CREATE TABLE employee_names (id NUMBER PRIMARY KEY, first_name VARCHAR2(50), last_name VARCHAR2(50))"; + try (OracleStatement createTableStatement = (OracleStatement) connection.createStatement()) { + createTableStatement.execute(createTableSQL); + System.out.println("Table 'employee_names' created successfully."); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + private void dropTable(OracleConnection connection) { + String dropTableSQL = "DROP TABLE employee_names"; + try (OracleStatement dropTableStatement = (OracleStatement) connection.createStatement()) { + dropTableStatement.execute(dropTableSQL); + System.out.println("Table 'employee_names' dropped successfully."); + } catch (SQLException e) { + e.printStackTrace(); + } + } +} diff --git a/java/jdbc-reactive-extensions-intro/src/main/resources/config.properties b/java/jdbc-reactive-extensions-intro/src/main/resources/config.properties new file mode 100644 index 00000000..562d101d --- /dev/null +++ b/java/jdbc-reactive-extensions-intro/src/main/resources/config.properties @@ -0,0 +1,7 @@ +HOST= +PORT= +DATABASE= +USER= +SCHEMA= +DB_TABLE_NAME=employee_names \ No newline at end of file diff --git a/java/jdbc-reactive-extensions-intro/src/sql/jdbc-reactive-extensions-intro.sql b/java/jdbc-reactive-extensions-intro/src/sql/jdbc-reactive-extensions-intro.sql new file mode 100644 index 00000000..1c1f69b4 --- /dev/null +++ b/java/jdbc-reactive-extensions-intro/src/sql/jdbc-reactive-extensions-intro.sql @@ -0,0 +1,33 @@ +-- THIS TABLE IS CREATED FROM JAVA CODE -> SQLStatementWithAsynchronousJDBC.java -> createTable() method +-- CREATE TABLE employee_names (id NUMBER PRIMARY KEY, first_name VARCHAR2(50), last_name VARCHAR2(50)) + +--IF YOU WANT TO CONFIRM YOU HAVE A TABLE WHILE ON DEBUGBING MODE +DESCRIBE employee_names; + +--IF YOU WANT TO CHECK THE TABLE RECORDS WHILE ON DEBUGGING MODE +SELECT * FROM employee_names; + +/* + +INSERT INTO employee_names (id, first_name, last_name) VALUES (1, 'John', 'Doe'); + +INSERT INTO employee_names (id, first_name, last_name) +VALUES (2, 'Jane', 'Smith'); + +INSERT INTO employee_names (id, first_name, last_name) +VALUES (3, 'David', 'Lee'); + +INSERT INTO employee_names (id, first_name, last_name) +VALUES (4, 'Emily', 'Jones'); + +INSERT INTO employee_names (id, first_name, last_name) +VALUES (5, 'Michael', 'Brown'); +COMMIT; + +*/ + +/* +-- TABLE IS DROPPED FROM JAVA CODE -> SQLStatementWithAsynchronousJDBC.java -> dropTable() method +DROP TABLE employee_names; +COMMIT; +*/ From 2d92243b28bcbd027597d1b8767481d2435c2e96 Mon Sep 17 00:00:00 2001 From: Ishan Chokshi Date: Tue, 25 Mar 2025 05:24:36 +0530 Subject: [PATCH 29/37] AQ JMS Examples with transactional semantics (#437) * AQ JMS Examples with atomic DML operation * Added License Text, log exceptions and remove hardcoded password. --- txeventq/jms-example/pom.xml | 38 ++++++++++ txeventq/jms-example/sql/stupTxEQ.sql | 33 ++++++++ .../JmsExactlyOnceConsumeProcessProduce.java | 75 +++++++++++++++++++ .../JmsTransactionalConsumer.java | 71 ++++++++++++++++++ .../JmsTransactionalProducer.java | 68 +++++++++++++++++ 5 files changed, 285 insertions(+) create mode 100644 txeventq/jms-example/pom.xml create mode 100644 txeventq/jms-example/sql/stupTxEQ.sql create mode 100644 txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsExactlyOnceConsumeProcessProduce.java create mode 100644 txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalConsumer.java create mode 100644 txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalProducer.java diff --git a/txeventq/jms-example/pom.xml b/txeventq/jms-example/pom.xml new file mode 100644 index 00000000..3b32a1ef --- /dev/null +++ b/txeventq/jms-example/pom.xml @@ -0,0 +1,38 @@ + + 4.0.0 + com.oracle.jms.example + AQ-JMS-Examples + 1.0 + jar + AQ JMS Examples + http://www.oracle.com + + + + com.oracle.database.messaging + aqapi-jakarta + 23.3.1.0 + + + + com.oracle.database.jdbc + ojdbc11 + 23.3.0.23.09 + + + + jakarta.transaction + jakarta.transaction-api + 2.0.1 + + + + jakarta.jms + jakarta.jms-api + 3.1.0 + + + \ No newline at end of file diff --git a/txeventq/jms-example/sql/stupTxEQ.sql b/txeventq/jms-example/sql/stupTxEQ.sql new file mode 100644 index 00000000..a9c0666f --- /dev/null +++ b/txeventq/jms-example/sql/stupTxEQ.sql @@ -0,0 +1,33 @@ +/* + ** Setup User and Queues for AQ-JMS + ** + ** Copyright (c) 2019, 2025 Oracle and/or its affiliates. + ** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + */ + +-- Create database user +create user aqjmsuser identified by Welcome_123#; +grant connect, resource to aqjmsuser; +grant execute on dbms_aq to aqjmsuser; +grant execute on dbms_aqadm to aqjmsuser; +grant execute on dbms_aqin to aqjmsuser; +grant unlimited tablespace to aqjmsuser; + +-- Create Transactional Event Queue TOPIC_IN and TOPIC_OUT. Add a consumer Consumer1 for both +Declare + subscriber sys.aq$_agent; +Begin + subscriber := sys.aq$_agent('Consumer1', NULL, NULL); + dbms_aqadm.create_transactional_event_queue(queue_name=>'aqjmsuser.TOPIC_IN', multiple_consumers=>TRUE); + dbms_aqadm.start_queue('aqjmsuser.TOPIC_IN'); +End; +/ + +Declare + subscriber sys.aq$_agent; +Begin + subscriber := sys.aq$_agent('Consumer1', NULL, NULL); + dbms_aqadm.create_transactional_event_queue(queue_name=>'aqjmsuser.TOPIC_OUT', multiple_consumers=>TRUE); + dbms_aqadm.start_queue('aqjmsuser.TOPIC_OUT'); +End; +/ \ No newline at end of file diff --git a/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsExactlyOnceConsumeProcessProduce.java b/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsExactlyOnceConsumeProcessProduce.java new file mode 100644 index 00000000..bf4b6b1f --- /dev/null +++ b/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsExactlyOnceConsumeProcessProduce.java @@ -0,0 +1,75 @@ +/* + ** JMS Exactly-Once processing. + ** + ** Copyright (c) 2019, 2025 Oracle and/or its affiliates. + ** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + */ + +package com.oracle.jms.example.transactional; + +public class JmsExactlyOnceConsumeProcessProduce { + public static void main(String[] args) { + try { + oracle.jdbc.pool.OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource(); + ods.setURL("jdbc:oracle:thin:@//:/"); + ods.setUser("aqjmsuser"); + ods.setPassword(""); // Password for aqjmsuser + jakarta.jms.TopicConnectionFactory cf = oracle.jakarta.jms.AQjmsFactory.getTopicConnectionFactory(ods); + jakarta.jms.TopicConnection jmsConn = cf.createTopicConnection(); + jakarta.jms.Session jmsSession = jmsConn.createTopicSession(true, jakarta.jms.Session.CLIENT_ACKNOWLEDGE); + jakarta.jms.Topic topicIn = jmsSession.createTopic("TOPIC_IN"); + jakarta.jms.MessageConsumer consumer = jmsSession.createDurableSubscriber(topicIn, "Consumer1"); + jakarta.jms.Topic topicOut = jmsSession.createTopic("TOPIC_OUT"); + jakarta.jms.MessageProducer jmsProducer = jmsSession.createProducer(topicOut); + jmsConn.start(); + jakarta.jms.Message msgConsumed = null; + try { + msgConsumed = consumer.receive(); //Consume message from TOPIC_IN topic + java.sql.Connection dbConn = ((oracle.jakarta.jms.AQjmsSession) jmsSession).getDBConnection(); + // Perform database operations for consumed message + String resultMessage = processMessage(msgConsumed,dbConn); + jakarta.jms.Message msgProduce = jmsSession.createTextMessage("PROCESSED:"+ resultMessage); + jmsProducer.send(msgProduce); //Send message to TOPIC_OUT + // Commit receive from TOPIC_IN ,Database operation and send to TOPIC_OUT + jmsSession.commit(); + System.out.println("Successfully Consumed one message from TOPIC_OUT and produced into TOPIC_IN"); + + } catch(Exception e){ + System.out.println("Exception while consuming, processing or producing JMS Message: " + e); + e.printStackTrace(); + try { + if(msgConsumed != null) { + jmsSession.rollback(); + } + }catch(Exception rollbackE) { + System.out.println("Exception during rollback : " + rollbackE); + rollbackE.printStackTrace(); + } + }finally { + try { + jmsSession.close(); + }catch(Exception closeE) { + System.out.println("Exception while clossing JMS Session: " + closeE); + closeE.printStackTrace(); + } + try { + jmsConn.close(); + }catch(Exception closeE) { + System.out.println("Exception while clossing JMS Connection: " + closeE); + closeE.printStackTrace(); + } + } + } catch (Exception e) { + System.out.println("Exception while setting up JMS Consumer and JMS Producer: " + e); + e.printStackTrace(); + } + } + + private static String processMessage(jakarta.jms.Message msg, java.sql.Connection dbConn) throws Exception + { + //Application specific DML Operation using dbConn. + //Intentionally left blank + + return msg.getBody(String.class); + } +} diff --git a/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalConsumer.java b/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalConsumer.java new file mode 100644 index 00000000..89e7be55 --- /dev/null +++ b/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalConsumer.java @@ -0,0 +1,71 @@ +/* + ** JMS Transactional Consumer example + ** + ** Copyright (c) 2019, 2025 Oracle and/or its affiliates. + ** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + */ + +package com.oracle.jms.example.transactional; + +public class JmsTransactionalConsumer { + + public static void main(String[] args) { + try { + oracle.jdbc.pool.OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource(); + ods.setURL("jdbc:oracle:thin:@//:/"); + ods.setUser("aqjmsuser"); + ods.setPassword(""); // Password for aqjmsuser + jakarta.jms.TopicConnectionFactory cf = oracle.jakarta.jms.AQjmsFactory.getTopicConnectionFactory(ods); + jakarta.jms.TopicConnection jmsConn = cf.createTopicConnection(); + jakarta.jms.Session jmsSession = jmsConn.createTopicSession(true, jakarta.jms.Session.CLIENT_ACKNOWLEDGE); + jakarta.jms.Topic topic = jmsSession.createTopic("TOPIC_OUT"); + jakarta.jms.MessageConsumer consumer = jmsSession.createDurableSubscriber(topic, "Consumer1"); + jmsConn.start(); + jakarta.jms.Message msg = null; + try { + //Consume message from Oracle Transactional Event Queue + msg = consumer.receive(); + java.sql.Connection dbConn = ((oracle.jakarta.jms.AQjmsSession) jmsSession).getDBConnection(); + // Perform database operations + processMessage(msg,dbConn); + // Commit database operation and the consumption of the message + jmsSession.commit(); + System.out.println("Successfully consumed one Message from topic TOPIC_OUT"); + } catch(Exception e) { + System.out.println("Exception while consuming JMS Message: "+ e); + e.printStackTrace(); + try { + if(msg != null) { + jmsSession.rollback(); + } + }catch(Exception rollbackE) { + System.out.println("Exception during rollback of consumed message: " + rollbackE); + rollbackE.printStackTrace(); + } + }finally { + try { + jmsSession.close(); + }catch(Exception closeE) { + System.out.println("Exception while clossing JMS Session: " + closeE); + closeE.printStackTrace(); + } + try { + jmsConn.close(); + }catch(Exception closeE) { + System.out.println("Exception while clossing JMS Connection: " + closeE); + closeE.printStackTrace(); + } + } + } catch (Exception e) { + System.out.println("Exception while setting up JMS Consumer: " + e); + e.printStackTrace(); + } + } + + private static void processMessage(jakarta.jms.Message msg, java.sql.Connection dbConn) throws Exception + { + //Application specific DML Operation + //Intentionally left blank + + } +} diff --git a/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalProducer.java b/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalProducer.java new file mode 100644 index 00000000..b8d45c23 --- /dev/null +++ b/txeventq/jms-example/src/main/java/com/oracle/jms/example/transactional/JmsTransactionalProducer.java @@ -0,0 +1,68 @@ +/* + ** JMS Transactional Producer example + ** + ** Copyright (c) 2019, 2025 Oracle and/or its affiliates. + ** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + */ + +package com.oracle.jms.example.transactional; + +public class JmsTransactionalProducer { + public static void main(String[] args) { + try { + oracle.jdbc.pool.OracleDataSource ods = new oracle.jdbc.pool.OracleDataSource(); + ods.setURL("jdbc:oracle:thin:@//:/"); + ods.setUser("aqjmsuser"); + ods.setPassword(""); // Password for aqjmsuser + jakarta.jms.TopicConnectionFactory cf = oracle.jakarta.jms.AQjmsFactory.getTopicConnectionFactory(ods); + jakarta.jms.TopicConnection jmsConn = cf.createTopicConnection(); + jakarta.jms.Session jmsSession = jmsConn.createTopicSession(true, jakarta.jms.Session.CLIENT_ACKNOWLEDGE); + jakarta.jms.Topic topic = jmsSession.createTopic("TOPIC_IN"); + jakarta.jms.MessageProducer jmsProducer = jmsSession.createProducer(topic); + jakarta.jms.Message msg = jmsSession.createTextMessage("JMS Test Message"); + // Get database connection which will be used to produce a message. + java.sql.Connection dbConn = ((oracle.jakarta.jms.AQjmsSession)jmsSession).getDBConnection(); + try { + // Perform database operations + processMessage(msg, dbConn); + // Send a message to Oracle Transactional Event Queue. + jmsProducer.send(msg); + // Commit Send and database operation + jmsSession.commit(); + System.out.println("Successfully Produced one Message into topic TOPIC_IN"); + }catch(Exception e) { + System.out.println("Exception while producing a message: " + e); + e.printStackTrace(); + try { + jmsSession.rollback(); + }catch(Exception rollbackE) { + System.out.println("Exception during rollback of JMS Session. " + rollbackE); + rollbackE.printStackTrace(); + } + }finally { + try { + jmsSession.close(); + }catch(Exception closeE) { + System.out.println("Exception while clossing JMS Session: " + closeE); + closeE.printStackTrace(); + } + try { + jmsConn.close(); + }catch(Exception closeE) { + System.out.println("Exception while clossing JMS Connection: " + closeE); + closeE.printStackTrace(); + } + } + } catch (Exception e) { + System.out.println("Exception while setting up JMS Producer" + e); + e.printStackTrace(); + } + } + + private static void processMessage(jakarta.jms.Message msg, java.sql.Connection dbConn) throws Exception + { + //Application specific DML Operation + //Intentionally left blank + + } +} From 762ba1216fc706f99f85feb8111f1eb6e40b49ba Mon Sep 17 00:00:00 2001 From: Gerald Venzl Date: Tue, 25 Mar 2025 01:33:15 +0100 Subject: [PATCH 30/37] Create JSON-to-Duality-View-Migrator-Tutorial.sql (#439) --- ...JSON-to-Duality-View-Migrator-Tutorial.sql | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 json-relational-duality/JSON-to-Duality-View-Migrator-Tutorial.sql diff --git a/json-relational-duality/JSON-to-Duality-View-Migrator-Tutorial.sql b/json-relational-duality/JSON-to-Duality-View-Migrator-Tutorial.sql new file mode 100644 index 00000000..09d6d1a2 --- /dev/null +++ b/json-relational-duality/JSON-to-Duality-View-Migrator-Tutorial.sql @@ -0,0 +1,237 @@ +/* +** Copyright (c) 2025 Oracle and/or its affiliates +** The Universal Permissive License (UPL), Version 1.0 +** +** Subject to the condition set forth below, permission is hereby granted to any +** person obtaining a copy of this software, associated documentation and/or data +** (collectively the "Software"), free of charge and under any and all copyright +** rights in the Software, and any and all patent rights owned or freely +** licensable by each licensor hereunder covering either (i) the unmodified +** Software as contributed to or provided by such licensor, or (ii) the Larger +** Works (as defined below), to deal in both +** +** (a) the Software, and +** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +** one is included with the Software (each a "Larger Work" to which the Software +** is contributed by such licensors), +** +** without restriction, including without limitation the rights to copy, create +** derivative works of, display, perform, and distribute the Software and make, +** use, sell, offer for sale, import, export, have made, and have sold the +** Software and the Larger Work(s), and to sublicense the foregoing rights on +** either these or other terms. +** +** This license is subject to the following condition: +** The above copyright notice and either this complete permission notice or at +** a minimum a reference to the UPL must be included in all copies or +** substantial portions of the Software. +** +** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +** SOFTWARE. +*/ + +-- TITLE +-- Working with the JSON-To-Duality Migrator using SQL +-- +-- DESCRIPTION +-- This tutorial script walks you through an example of working with +-- the JSON-To-Duality Migrator using Conference scheduling data +-- through SQL. +-- +-- PREREQUISITES +-- Ensure that you have Oracle Database 23ai installed and running on a +-- port. Ensure that the compatible parameter is set to 23.0.0.0. +-- +-- USAGE +-- Connect to the database as a regular (non-SYS) user and run this +-- script. The user must have the DB_DEVELOPER_ROLE and privileges +-- on the default tablespace. +-- A demo user can be created using this statement: +-- CREATE USER IDENTIFIED BY QUOTA UNLIMITED ON ; +-- GRANT DB_DEVELOPER_ROLE TO ; +-- +-- NOTES +-- Please go through the duality view documentation +-- (https://docs.oracle.com/en/database/oracle/oracle-database/23/jsnvu/index.html) +-- before this to learn more about duality views and their advantages. + +-- We start by populating the initial JSON data. We have three collections, +-- Speaker, Attendee, and Sessions. + +CREATE TABLE IF NOT EXISTS SPEAKER (data JSON); +CREATE TABLE IF NOT EXISTS ATTENDEE (data JSON); +CREATE TABLE IF NOT EXISTS SESSIONS (data JSON); + +INSERT INTO SPEAKER VALUES + ('{"_id" : 101, + "name" : "Abdul J.", + "phoneNumber" : "222-555-011", + "yearsAtOracle" : 25, + "department" : "Product Management", + "sessionsTaught" : [ {"sessionName" : "JSON and SQL", "type" : "Online", "credits" : 3}, + {"sessionName" : "PL/SQL or Javascript", "type" : "In-person", "credits" : 5} ]}' + ), + ('{"_id" : 102, + "name" : "Betty Z.", + "yearsAtOracle" : 30, + "department" : "Autonomous Databases", + "sessionsTaught" : [ {"sessionName" : "Oracle ADB on iPhone", "type" : "Online", "credits" : 3}, + {"sessionName" : "MongoDB API Internals", "type" : "In-person", "credits" : 4} ]}' + ), + ('{"_id" : 103, + "name" : "Colin J.", + "phoneNumber" : "222-555-023", + "yearsAtOracle" : 27, + "department" : "In-Memory and Data", + "sessionsTaught" : [ {"sessionName" : "JSON Duality Views", "type" : "Online", "credits" : 3} ]}' + ); + +INSERT INTO ATTENDEE VALUES + ('{"_id" : 1, + "name" : "Donald P.", + "age" : 20, + "phoneNumber" : "222-111-021", + "grade" : "A", + "sessions" : [ {"sessionName" : "JSON and SQL", "credits" : 3}, + {"sessionName" : "PL/SQL or Javascript", "credits" : 5}, + {"sessionName" : "MongoDB API Internals", "credits" : 4}, + {"sessionName" : "JSON Duality Views", "credits" : 3}, + {"sessionName" : "Oracle ADB on iPhone", "credits" : 3} ]}' + ), + ('{"_id" : 2, + "name" : "Elena H.", + "age" : 22, + "phoneNumber" : "222-112-022", + "grade" : "B", + "sessions" : [ {"sessionName" : "JSON Duality Views", "credits" : 3}, + {"sessionName" : "MongoDB API Internals", "credits" : 4}, + {"sessionName" : "JSON and SQL", "credits" : 3} ]}' + ), + ('{"_id" : 3, + "name" : "Francis K.", + "age" : 23, + "phoneNumber" : "222-112-022", + "grade" : "C", + "sessions" : [ {"sessionName" : "MongoDB API Internals", "credits" : 4}, + {"sessionName" : "JSON and SQL", "credits" : 3} ]}' + ), + ('{"_id" : 4, + "name" : "Jatin S.", + "age" : 24, + "phoneNumber" : "222-113-023", + "grade" : "D", + "sessions" : [ {"sessionName" : "JSON Duality Views", "credits" : 3} ]}' + ); + +INSERT INTO SESSIONS VALUES + ('{"_id" : "10", + "sessionName" : "JSON and SQL", + "creditHours" : 3, + "attendeesEnrolled" : [ {"_id" : 1, "name" : "Donald P."}, {"_id" : 3, "name" : "Francis K."} ]}' + ), + ('{"_id" : "20", + "sessionName" : "PL/SQL or Javascript", + "creditHours" : 5, + "attendeesEnrolled" : [ {"_id" : 1, "name" : "Donald P."} ]}' + ), + ('{"_id" : "30", + "sessionName" : "MongoDB API Internals", + "creditHours" : 4, + "attendeesEnrolled" : [ {"_id" : 1, "name" : "Donald P."}, {"_id" : 2, "name" : "Elena H."}, {"_id" : 3, "name" : "Francis K."} ]}' + ), + ('{"_id" : "40", + "sessionName" : "Oracle ADB on iPhone", + "creditHours" : 3, + "attendeesEnrolled" : [{"_id" : 1, "name" : "Donald P."}]}' + ), + ('{"_id" : "50", + "sessionName" : "JSON Duality Views", + "creditHours" : 3, + "attendeesEnrolled" : [ {"_id" : 1, "name" : "Donald P."}, {"_id" : 2, "name" : "Elena H."}, {"_id" : 4, "name" : "Jatin S."} ]}' + ); + +COMMIT; + +-- Next, we run the JSON-to-Duality Migrator by invoking the +-- infer_and_generate_schema procedure. + +SET SERVEROUTPUT ON +DECLARE + schema_sql CLOB; +BEGIN + -- Infer relational schema + schema_sql := + DBMS_JSON_DUALITY.INFER_AND_GENERATE_SCHEMA( + JSON('{"tableNames" : [ "ATTENDEE", "SPEAKER", "SESSIONS" ], + "useFlexFields" : true, + "updatability" : true, + "minFieldFrequency" : 0, + "minTypeFrequency" : 0}' + ) + ); + + -- Print DDL script + DBMS_OUTPUT.PUT_LINE('DDL Script: '); + DBMS_OUTPUT.PUT_LINE(schema_sql); + + -- Create relational schema + EXECUTE IMMEDIATE schema_sql; +END; +/ + +-- Let’s check the objects created by the tool. +-- Note that the relational schema is completely normalized - one table is +-- created per logical entity, one for speaker (speaker_root), one for attendee +-- (attendee_root), and one for sessions (sessions_root). The many-to-many +-- relationship between attendees and sessions is automatically identified and +-- a mapping table is created to map attendees to sessions. + +SELECT object_name, object_type + FROM user_objects + WHERE created > sysdate-1/24 + ORDER BY object_type DESC; + +-- Now, let’s validate the schema, which shows no errors (no rows selected) for +-- each duality view, which means that there are no validation failures. + +SELECT * FROM DBMS_JSON_DUALITY.VALIDATE_SCHEMA_REPORT(table_name => 'SESSIONS', view_name => 'SESSIONS_DUALITY'); +SELECT * FROM DBMS_JSON_DUALITY.VALIDATE_SCHEMA_REPORT(table_name => 'ATTENDEE', view_name => 'ATTENDEE_DUALITY'); +SELECT * FROM DBMS_JSON_DUALITY.VALIDATE_SCHEMA_REPORT(table_name => 'SPEAKER', view_name => 'SPEAKER_DUALITY'); + +-- Let’s create error logs to log errors for documents that do not get imported +-- successfully. + +BEGIN + DBMS_ERRLOG.CREATE_ERROR_LOG(dml_table_name => 'SESSIONS', err_log_table_name => 'SESSIONS_ERR_LOG', skip_unsupported => TRUE); + DBMS_ERRLOG.CREATE_ERROR_LOG(dml_table_name => 'ATTENDEE', err_log_table_name => 'ATTENDEE_ERR_LOG', skip_unsupported => TRUE); + DBMS_ERRLOG.CREATE_ERROR_LOG(dml_table_name => 'SPEAKER', err_log_table_name => 'SPEAKER_ERR_LOG', skip_unsupported => TRUE); +END; +/ + +-- Let’s import the data into the duality views. + +BEGIN + DBMS_JSON_DUALITY.IMPORT_ALL( + JSON('{"tableNames" : [ "SESSIONS","ATTENDEE","SPEAKER" ], + "viewNames" : [ "SESSIONS_DUALITY","ATTENDEE_DUALITY","SPEAKER_DUALITY" ], + "errorLog" : [ "SESSIONS_ERR_LOG","ATTENDEE_ERR_LOG","SPEAKER_ERR_LOG" ]}' + ) + ); +END; +/ + +-- The error logs are empty, showing that there are no import errors — there +-- are no documents that did not get imported. + +SELECT ora_err_number$, ora_err_mesg$, ora_err_tag$ FROM SESSIONS_ERR_LOG; +SELECT ora_err_number$, ora_err_mesg$, ora_err_tag$ FROM ATTENDEE_ERR_LOG; +SELECT ora_err_number$, ora_err_mesg$, ora_err_tag$ FROM SPEAKER_ERR_LOG; + +-- Super simple, isn’t it? +-- Download the Oracle Database 23ai Free version from oracle.com/database/free +-- and try it today! From 702509060284c4849c7ee12e5e0c7e17785fd598 Mon Sep 17 00:00:00 2001 From: Ivan Brezina Date: Fri, 2 May 2025 10:45:12 +0200 Subject: [PATCH 31/37] Use Windows SSPI API to generate kerberos ticket for JDBC SSO (#441) * Use Windows SSPI API to generate Kerberos ticket for JDBC SSO * Use 2 space characters for indentation * Comment out setting sun.security.jgss.lib property, it is not needed anymore * Use set insted of export on Windows * Typo fixes --- .../GSSAuthSSPIConnectSample.java | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 java/jdbc/ConnectionSamples/GSSAuthSSPIConnectSample.java diff --git a/java/jdbc/ConnectionSamples/GSSAuthSSPIConnectSample.java b/java/jdbc/ConnectionSamples/GSSAuthSSPIConnectSample.java new file mode 100644 index 00000000..328685cf --- /dev/null +++ b/java/jdbc/ConnectionSamples/GSSAuthSSPIConnectSample.java @@ -0,0 +1,136 @@ +/* + Copyright (c) 2025, Oracle and/or its affiliates. + + This software is dual-licensed to you under the Universal Permissive License + (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License + 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose + either license. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + DESCRIPTION + This sample shows how to use SSO uging Kerberos on Windows. + Since WIN2019 allowtgtsessionkey registry key is not available + and the only option how to acces Kerberos TGT is via Java's SSPI bridge. + + PREREQUISITIES + - Configure Kerberos authentication for Oracle database as described here: + https://blog.pythian.com/part-4-implementing-oracle-database-single-sign-on-using-kerberos-active-directory-and-oracle-cmu/ + + - Create DB user identified extenally as: + CREATE USER IDENTIFIED EXTERNALLY AS '@'; + GRANT CONNECT TO ; + + - Check your Windows has generater Kerb tickets during logon + klist tgt + klist + + - Connect to database using this program. + Java's SSPI bridge(sspi_bridge.dll) should be used to renerate required Kerberos ticket for SSO. + + NOTES + Use JDK 13 and above on Windows. Check presence of sspi_bridge.dll in JDK intalation. + + MODIFIED (MM/DD/YY) + ibre5041 18/04/2025 - Creation +*/ + +package kerb; + +import java.sql.ResultSet; +import java.sql.Statement; + +import java.util.Properties; + +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.Oid; + +import oracle.jdbc.OracleConnection; +import oracle.jdbc.OracleConnectionBuilder; +import oracle.jdbc.pool.OracleDataSource; +import oracle.net.ano.AnoServices; + +public class GSSAuthSSPIConnectSample { + // This should return your AD LOGIN + String username = System.getProperty("user.name"); + // This should return your AD KERBEROS REALM + String domain = System.getenv("USERDNSDOMAIN"); + // Your Database JDBC URL here + String url = "jdbc:oracle:thin:@//dbhost1:1521/DBSERVICE"; + + public GSSAuthSSPIConnectSample() { + } + + public void doit() throws Exception + { + // Use env variable SSPI_BRIDGE_TRACE=1 in order to trace Java's sspi_bridge.dll plugin + // set SSPI_BRIDGE_TRACE=1 + + // Various useful tracing options + // System.setProperty("oracle.jdbc.Trace", "true"); + // System.setProperty("sun.security.krb5.debug", "true"); + // System.setProperty("sun.security.spnego.debug", "true"); + // System.setProperty("sun.security.jgss.debug", "true"); + // System.setProperty("java.security.debug", "true"); + // System.setProperty("sun.security.nativegss.debug", "true"); + + // Activate SSPI bridge, your Kerberos token will be created using Windows SSPI API + System.setProperty("sun.security.jgss.native", "true"); + // Uncomment this this line for JDK 11, for newer JDK versions this value should be default + // System.setProperty("sun.security.jgss.lib", "sspi_bridge.dll"); + + Oid krb5Oid = new Oid("1.2.840.113554.1.2.2"); + GSSManager manager = GSSManager.getInstance(); + + GSSName srcName = manager.createName(username + "@" + domain, GSSName.NT_USER_NAME); + GSSCredential cred = manager.createCredential(srcName + , GSSCredential.DEFAULT_LIFETIME + , krb5Oid, GSSCredential.INITIATE_ONLY); + + Properties prop = new Properties(); + prop.setProperty(AnoServices.AUTHENTICATION_PROPERTY_SERVICES, "(" + AnoServices.AUTHENTICATION_KERBEROS5 + ")"); + prop.setProperty(OracleConnection.CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_SERVICES,"( " + AnoServices.AUTHENTICATION_KERBEROS5 + " )"); + prop.setProperty(OracleConnection.CONNECTION_PROPERTY_THIN_NET_AUTHENTICATION_KRB5_MUTUAL, "true"); + + OracleDataSource ods = new OracleDataSource(); + ods.setURL(url); + ods.setConnectionProperties(prop); + OracleConnectionBuilder builder = ods.createConnectionBuilder(); + OracleConnection conn = builder.gssCredential(cred).build(); + + String auth = ((OracleConnection)conn).getAuthenticationAdaptorName(); + System.out.println("Authentication adaptor:"+auth); + + String sql = "select user from dual"; + Statement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery(sql); + while (rs.next()) + System.out.println("whoami: " + rs.getString(1)); + + conn.close(); + } + + public static void main(String[] args) { + GSSAuthSSPIConnectSample test = new GSSAuthSSPIConnectSample(); + try { + test.doit(); + System.out.println("Done"); + } catch (Exception e) { + e.printStackTrace(); + } + } +} From 1f64c2e3d77785cc601697f0323d170e7c7722b4 Mon Sep 17 00:00:00 2001 From: Mohammed Bekraoui Date: Fri, 23 May 2025 10:57:01 +0100 Subject: [PATCH 32/37] Sessionless transactions demo (#442) * Sessionless transactions demo * Rollback if start transaction request fails * Remove DTO suffix * Remove fixme * Update copyright * Add concurrency tests --- java/jdbc/SessionlessTransactions/.gitignore | 32 ++ java/jdbc/SessionlessTransactions/LICENSE.txt | 35 ++ java/jdbc/SessionlessTransactions/README.md | 30 ++ java/jdbc/SessionlessTransactions/mvnw | 308 ++++++++++++++++++ java/jdbc/SessionlessTransactions/mvnw.cmd | 205 ++++++++++++ java/jdbc/SessionlessTransactions/pom.xml | 67 ++++ .../SessionlessTransactionsDemo.java | 16 + .../controller/BookingController.java | 97 ++++++ .../controller/BookingControllerAdvice.java | 25 ++ .../sessionlesstxns/dto/CheckoutRequest.java | 11 + .../sessionlesstxns/dto/CheckoutResponse.java | 22 ++ .../sessionlesstxns/dto/ErrorResponse.java | 12 + .../dto/RemoveTicketRequest.java | 11 + .../dto/RequestTicketsRequest.java | 12 + .../dto/RequestTicketsResponse.java | 13 + .../dto/StartTransactionRequest.java | 12 + .../dto/StartTransactionResponse.java | 15 + .../exception/APIException.java | 27 ++ .../exception/BookingNotFoundException.java | 14 + .../exception/NoFreeSeatFoundException.java | 14 + .../exception/NoTicketFoundException.java | 14 + .../exception/PaymentFailedException.java | 14 + .../TransactionNotFoundException.java | 15 + .../exception/UnexpectedException.java | 15 + .../service/BookingService.java | 299 +++++++++++++++++ .../service/PaymentService.java | 20 ++ .../samples/sessionlesstxns/util/Util.java | 31 ++ .../src/main/resources/application.properties | 17 + .../samples/sessionlesstxns/TestApis.java | 153 +++++++++ .../samples/sessionlesstxns/TestBase.java | 158 +++++++++ .../sessionlesstxns/TestConcurrency.java | 111 +++++++ .../src/test/resources/application.properties | 17 + .../src/test/resources/createSchema.sql | 54 +++ .../src/test/resources/createUser.sql | 11 + .../src/test/resources/dataCleaner.sql | 11 + .../src/test/resources/dataLoader.sql | 14 + .../src/test/resources/dropSchema.sql | 11 + .../src/test/resources/hundredsSeats.sql | 108 ++++++ 38 files changed, 2051 insertions(+) create mode 100644 java/jdbc/SessionlessTransactions/.gitignore create mode 100644 java/jdbc/SessionlessTransactions/LICENSE.txt create mode 100644 java/jdbc/SessionlessTransactions/README.md create mode 100755 java/jdbc/SessionlessTransactions/mvnw create mode 100644 java/jdbc/SessionlessTransactions/mvnw.cmd create mode 100644 java/jdbc/SessionlessTransactions/pom.xml create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/SessionlessTransactionsDemo.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingController.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingControllerAdvice.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutRequest.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutResponse.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/ErrorResponse.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RemoveTicketRequest.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsRequest.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsResponse.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionRequest.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionResponse.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/APIException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/BookingNotFoundException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoFreeSeatFoundException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoTicketFoundException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/PaymentFailedException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/TransactionNotFoundException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/UnexpectedException.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/PaymentService.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/util/Util.java create mode 100644 java/jdbc/SessionlessTransactions/src/main/resources/application.properties create mode 100644 java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java create mode 100644 java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java create mode 100644 java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/application.properties create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/createSchema.sql create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/createUser.sql create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/dataCleaner.sql create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/dataLoader.sql create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/dropSchema.sql create mode 100644 java/jdbc/SessionlessTransactions/src/test/resources/hundredsSeats.sql diff --git a/java/jdbc/SessionlessTransactions/.gitignore b/java/jdbc/SessionlessTransactions/.gitignore new file mode 100644 index 00000000..7ed0d6b6 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/.gitignore @@ -0,0 +1,32 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/java/jdbc/SessionlessTransactions/LICENSE.txt b/java/jdbc/SessionlessTransactions/LICENSE.txt new file mode 100644 index 00000000..8dc7c070 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/LICENSE.txt @@ -0,0 +1,35 @@ +Copyright (c) 2025 Oracle and/or its affiliates. + +The Universal Permissive License (UPL), Version 1.0 + +Subject to the condition set forth below, permission is hereby granted to any +person obtaining a copy of this software, associated documentation and/or data +(collectively the "Software"), free of charge and under any and all copyright +rights in the Software, and any and all patent rights owned or freely +licensable by each licensor hereunder covering either (i) the unmodified +Software as contributed to or provided by such licensor, or (ii) the Larger +Works (as defined below), to deal in both + +(a) the Software, and +(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +one is included with the Software (each a "Larger Work" to which the Software +is contributed by such licensors), + +without restriction, including without limitation the rights to copy, create +derivative works of, display, perform, and distribute the Software and make, +use, sell, offer for sale, import, export, have made, and have sold the +Software and the Larger Work(s), and to sublicense the foregoing rights on +either these or other terms. + +This license is subject to the following condition: +The above copyright notice and either this complete permission notice or at +a minimum a reference to the UPL must be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/java/jdbc/SessionlessTransactions/README.md b/java/jdbc/SessionlessTransactions/README.md new file mode 100644 index 00000000..2cd6bb52 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/README.md @@ -0,0 +1,30 @@ +## Overview + +This project demonstrates the use of sessionless transactions feature of Oracle Database using JDBC. + +The project is a web service that handles booking requests. + +## Building and testing + +Create a test user: + +~~~SQL +CREATE USER test_user IDENTIFIED BY test_password; +GRANT CREATE SESSION TO test_user; +GRANT CREATE TABLE TO test_user; +GRANT CREATE SEQUENCE TO test_user; +GRANT DROP ANY TABLE TO test_user; +GRANT UNLIMITED TABLESPACE TO test_user; +~~~ + +Please set the database URL as an environment variable before running the application. + +**Example:** +~~~ +export TEST_DATABASE_URL=jdbc:oracle:thin:@localhost:5221:orcl +~~~ + +**Build and run endpoint tests:** +~~~ +mvn install +~~~ \ No newline at end of file diff --git a/java/jdbc/SessionlessTransactions/mvnw b/java/jdbc/SessionlessTransactions/mvnw new file mode 100755 index 00000000..66df2854 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/mvnw @@ -0,0 +1,308 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.2.0 +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "$(uname)" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME + else + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=$(java-config --jre-home) + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --unix "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --unix "$CLASSPATH") +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && + JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="$(which javac)" + if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=$(which readlink) + if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then + if $darwin ; then + javaHome="$(dirname "\"$javaExecutable\"")" + javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" + else + javaExecutable="$(readlink -f "\"$javaExecutable\"")" + fi + javaHome="$(dirname "\"$javaExecutable\"")" + javaHome=$(expr "$javaHome" : '\(.*\)/bin') + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=$(cd "$wdir/.." || exit 1; pwd) + fi + # end of workaround + done + printf '%s' "$(cd "$basedir" || exit 1; pwd)" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + # Remove \r in case we run on Windows within Git Bash + # and check out the repository with auto CRLF management + # enabled. Otherwise, we may read lines that are delimited with + # \r\n and produce $'-Xarg\r' rather than -Xarg due to word + # splitting rules. + tr -s '\r\n' ' ' < "$1" + fi +} + +log() { + if [ "$MVNW_VERBOSE" = true ]; then + printf '%s\n' "$1" + fi +} + +BASE_DIR=$(find_maven_basedir "$(dirname "$0")") +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR +log "$MAVEN_PROJECTBASEDIR" + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" +if [ -r "$wrapperJarPath" ]; then + log "Found $wrapperJarPath" +else + log "Couldn't find $wrapperJarPath, downloading it ..." + + if [ -n "$MVNW_REPOURL" ]; then + wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + else + wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + fi + while IFS="=" read -r key value; do + # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) + safeValue=$(echo "$value" | tr -d '\r') + case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; + esac + done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" + log "Downloading from: $wrapperUrl" + + if $cygwin; then + wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") + fi + + if command -v wget > /dev/null; then + log "Found wget ... using wget" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + log "Found curl ... using curl" + [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + else + curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" + fi + else + log "Falling back to using Java to download" + javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" + javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaSource=$(cygpath --path --windows "$javaSource") + javaClass=$(cygpath --path --windows "$javaClass") + fi + if [ -e "$javaSource" ]; then + if [ ! -e "$javaClass" ]; then + log " - Compiling MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/javac" "$javaSource") + fi + if [ -e "$javaClass" ]; then + log " - Running MavenWrapperDownloader.java ..." + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +# If specified, validate the SHA-256 sum of the Maven wrapper jar file +wrapperSha256Sum="" +while IFS="=" read -r key value; do + case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; + esac +done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" +if [ -n "$wrapperSha256Sum" ]; then + wrapperSha256Result=false + if command -v sha256sum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + elif command -v shasum > /dev/null; then + if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then + wrapperSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." + echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." + exit 1 + fi + if [ $wrapperSha256Result = false ]; then + echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 + echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 + echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 + exit 1 + fi +fi + +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$JAVA_HOME" ] && + JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") + [ -n "$CLASSPATH" ] && + CLASSPATH=$(cygpath --path --windows "$CLASSPATH") + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# shellcheck disable=SC2086 # safe args +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/java/jdbc/SessionlessTransactions/mvnw.cmd b/java/jdbc/SessionlessTransactions/mvnw.cmd new file mode 100644 index 00000000..95ba6f54 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/mvnw.cmd @@ -0,0 +1,205 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.2.0 +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %WRAPPER_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file +SET WRAPPER_SHA_256_SUM="" +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B +) +IF NOT %WRAPPER_SHA_256_SUM%=="" ( + powershell -Command "&{"^ + "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ + "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ + " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ + " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ + " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ + " exit 1;"^ + "}"^ + "}" + if ERRORLEVEL 1 goto error +) + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/java/jdbc/SessionlessTransactions/pom.xml b/java/jdbc/SessionlessTransactions/pom.xml new file mode 100644 index 00000000..dcdc6056 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/pom.xml @@ -0,0 +1,67 @@ + + + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.2.2 + + + com.oracle.jdbc.samples + sessionlesstxns + 0.0.1-SNAPSHOT + SessionlessTransactionsDemo + Sessionless transactions demo + + 21 + 23.8.0.25.04 + + + + org.springframework.boot + spring-boot-starter-data-jdbc + + + + org.springframework.boot + spring-boot-starter-web + + + + com.oracle.database.jdbc + ojdbc17 + ${ojdbc.version} + + + + com.oracle.database.jdbc + ucp17 + ${ojdbc.version} + + + + com.oracle.database.ha + ons + ${ojdbc.version} + + + + org.springframework.boot + spring-boot-starter-test + test + + + + io.rest-assured + rest-assured + 5.5.1 + test + + + diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/SessionlessTransactionsDemo.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/SessionlessTransactionsDemo.java new file mode 100644 index 00000000..b74fd311 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/SessionlessTransactionsDemo.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SessionlessTransactionsDemo { + public static void main(String[] args) { + SpringApplication.run(SessionlessTransactionsDemo.class, args); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingController.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingController.java new file mode 100644 index 00000000..1f959ba2 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingController.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.controller; + +import com.oracle.jdbc.samples.sessionlesstxns.dto.CheckoutRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.CheckoutResponse; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RemoveTicketRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.StartTransactionRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RequestTicketsRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RequestTicketsResponse; +import com.oracle.jdbc.samples.sessionlesstxns.dto.StartTransactionResponse; +import com.oracle.jdbc.samples.sessionlesstxns.service.BookingService; +import com.oracle.jdbc.samples.sessionlesstxns.service.PaymentService; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +@CrossOrigin(originPatterns = "http://localhost:**") +@Controller +@RequestMapping("/api/v1/bookings") +public class BookingController { + + BookingService bookingService; + + public BookingController(BookingService bookingService) { + this.bookingService = bookingService; + } + + /** + * Start a new transaction, and request first flight ticket(s). + */ + @PostMapping + public ResponseEntity startTransaction(@RequestBody StartTransactionRequest body) { + + StartTransactionResponse response = bookingService.startTransaction(body); + + if (body.count() > response.count()) { + return new ResponseEntity<>(response, HttpStatus.PARTIAL_CONTENT); + } + + return new ResponseEntity<>(response, HttpStatus.CREATED); + } + + /** + * Resume transaction and request more tickets. + */ + @PostMapping(value = {"/{bookingId}"}) + public ResponseEntity requestTickets(@PathVariable Long bookingId, + @RequestBody RequestTicketsRequest body) { + RequestTicketsResponse response = bookingService.requestTickets(bookingId, body); + + if (body.count() > response.count()) { + return new ResponseEntity<>(response, HttpStatus.PARTIAL_CONTENT); + } + + return new ResponseEntity<>(response, HttpStatus.CREATED); + } + + /** + * Remove tickets from the booking order. + */ + @DeleteMapping(value = {"/{bookingId}"}) + public ResponseEntity removeTicket(@PathVariable Long bookingId, + @RequestBody RemoveTicketRequest body) { + bookingService.removeTicket(bookingId, body.seatId(), body.transactionId()); + + return new ResponseEntity<>(HttpStatus.OK); + } + + /** + * Pay and complete booking order. + */ + @PostMapping(value = {"/{bookingId}/checkout"}) + public ResponseEntity checkout(@PathVariable Long bookingId, + @RequestBody CheckoutRequest body) { + return new ResponseEntity<>(bookingService.checkout(bookingId, body), HttpStatus.CREATED); + } + + /** + * Cancel booking. + */ + @PostMapping(value = {"/cancel/{transactionId}"}) + public ResponseEntity cancelBooking(@PathVariable String transactionId) { + bookingService.cancelBooking(transactionId); + + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingControllerAdvice.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingControllerAdvice.java new file mode 100644 index 00000000..15732d60 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/controller/BookingControllerAdvice.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.controller; + +import com.oracle.jdbc.samples.sessionlesstxns.dto.ErrorResponse; +import com.oracle.jdbc.samples.sessionlesstxns.exception.APIException; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +@RestControllerAdvice +public class BookingControllerAdvice { + @ExceptionHandler({APIException.class}) + public ResponseEntity handleAPIException(APIException ex) { + ErrorResponse errorResponse = new ErrorResponse( + ex.getHttpStatus().value(), + ex.getHttpStatus().name(), + ex.getMessage()); + + return new ResponseEntity<>(errorResponse, ex.getHttpStatus()); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutRequest.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutRequest.java new file mode 100644 index 00000000..af1eedc5 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutRequest.java @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +public record CheckoutRequest( + String transactionId, + Long paymentMethod +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutResponse.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutResponse.java new file mode 100644 index 00000000..5823b75e --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/CheckoutResponse.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +import java.util.List; + +public record CheckoutResponse( + Long id, + List tickets, + double total, + String receiptNumber, + Long paymentMethod +) { + public static record TicketDTO( + Long seatId, + Long flightId, + Float price + ) {} +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/ErrorResponse.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/ErrorResponse.java new file mode 100644 index 00000000..a714b1b6 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/ErrorResponse.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +public record ErrorResponse( + int statusCode, + String error, + String message +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RemoveTicketRequest.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RemoveTicketRequest.java new file mode 100644 index 00000000..be7a168c --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RemoveTicketRequest.java @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +public record RemoveTicketRequest( + String transactionId, + Long seatId +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsRequest.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsRequest.java new file mode 100644 index 00000000..ed544563 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsRequest.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +public record RequestTicketsRequest( + String transactionId, + Long flightId, + int count +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsResponse.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsResponse.java new file mode 100644 index 00000000..9e1dece7 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/RequestTicketsResponse.java @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +import java.util.List; + +public record RequestTicketsResponse( + Integer count, + List seatIds +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionRequest.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionRequest.java new file mode 100644 index 00000000..cdef0095 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionRequest.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +public record StartTransactionRequest( + int timeout, + long flightId, + int count +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionResponse.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionResponse.java new file mode 100644 index 00000000..6dc1723a --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/dto/StartTransactionResponse.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.dto; + +import java.util.List; + +public record StartTransactionResponse( + Long bookingId, + String transactionId, + Integer count, + List seatIds +) {} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/APIException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/APIException.java new file mode 100644 index 00000000..c8969695 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/APIException.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class APIException extends RuntimeException { + private HttpStatus httpStatus; + private String message; + + public APIException(HttpStatus httpsStatus, String message) { + super(message); + this.message = message; + this.httpStatus = httpsStatus; + } + + public HttpStatus getHttpStatus() { + return httpStatus; + } + + public String getMessage() { + return message; + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/BookingNotFoundException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/BookingNotFoundException.java new file mode 100644 index 00000000..0ae09b80 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/BookingNotFoundException.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class BookingNotFoundException extends APIException { + public BookingNotFoundException(long bookingId) { + super(HttpStatus.NOT_FOUND, "Booking " + bookingId + " not found."); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoFreeSeatFoundException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoFreeSeatFoundException.java new file mode 100644 index 00000000..eb405007 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoFreeSeatFoundException.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class NoFreeSeatFoundException extends APIException { + public NoFreeSeatFoundException(long flightId) { + super(HttpStatus.NOT_FOUND, "No free seat found for flight: " + flightId); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoTicketFoundException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoTicketFoundException.java new file mode 100644 index 00000000..0ba76b40 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/NoTicketFoundException.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class NoTicketFoundException extends APIException { + public NoTicketFoundException(long seatId, long bookingId) { + super(HttpStatus.NOT_FOUND, "Booking order " + bookingId + " does not have any tickets with seat " + seatId); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/PaymentFailedException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/PaymentFailedException.java new file mode 100644 index 00000000..1f5a34c2 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/PaymentFailedException.java @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class PaymentFailedException extends APIException { + public PaymentFailedException() { + super(HttpStatus.PAYMENT_REQUIRED, "Payment failed"); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/TransactionNotFoundException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/TransactionNotFoundException.java new file mode 100644 index 00000000..9337198f --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/TransactionNotFoundException.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class TransactionNotFoundException extends APIException { + + public TransactionNotFoundException(String transaction_id) { + super(HttpStatus.NOT_FOUND, "Transaction " + transaction_id + " not found"); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/UnexpectedException.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/UnexpectedException.java new file mode 100644 index 00000000..6efc865d --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/exception/UnexpectedException.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.exception; + +import org.springframework.http.HttpStatus; + +public class UnexpectedException extends APIException { + public UnexpectedException(Throwable cause) { + super(HttpStatus.INTERNAL_SERVER_ERROR, "An unexpected error has occurred"); + initCause(cause); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java new file mode 100644 index 00000000..be0feb0f --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.service; + +import com.oracle.jdbc.samples.sessionlesstxns.dto.CheckoutRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.CheckoutResponse; +import com.oracle.jdbc.samples.sessionlesstxns.dto.StartTransactionRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RequestTicketsRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RequestTicketsResponse; +import com.oracle.jdbc.samples.sessionlesstxns.dto.StartTransactionResponse; +import com.oracle.jdbc.samples.sessionlesstxns.exception.APIException; +import com.oracle.jdbc.samples.sessionlesstxns.exception.BookingNotFoundException; +import com.oracle.jdbc.samples.sessionlesstxns.exception.NoFreeSeatFoundException; +import com.oracle.jdbc.samples.sessionlesstxns.exception.NoTicketFoundException; +import com.oracle.jdbc.samples.sessionlesstxns.exception.TransactionNotFoundException; +import com.oracle.jdbc.samples.sessionlesstxns.exception.UnexpectedException; +import com.oracle.jdbc.samples.sessionlesstxns.util.Util; +import oracle.jdbc.OracleConnection; +import oracle.jdbc.OraclePreparedStatement; +import org.springframework.stereotype.Service; + +import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Savepoint; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; + +@Service +public class BookingService { + DataSource connectionPool; + PaymentService paymentService; + static final int INTEGRITY_CONSTRAINT_ERROR = 2291; + static final int TRANSACTION_NOT_FOUND_ERROR = 26218; + + public BookingService(DataSource dataSource, @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") PaymentService paymentService) { + this.connectionPool = dataSource; + this.paymentService = paymentService; + } + + public StartTransactionResponse startTransaction(StartTransactionRequest body) { + try (OracleConnection conn = (OracleConnection) connectionPool.getConnection(); + AutoCloseable rollback = conn::rollback;) { + conn.setAutoCommit(false); + byte[] gtrid = conn.startTransaction(body.timeout() * 60); + + long bookingId = createBooking(conn); + + List seats = lockAndBookSeats(conn, bookingId, body.flightId(), body.count()); + conn.suspendTransaction(); + + return new StartTransactionResponse(bookingId, Util.byteArrayToHex(gtrid), seats.size(), seats); + } catch (APIException ex) { + throw ex; + } catch (Exception ex) { + throw new UnexpectedException(ex); + } + } + + public RequestTicketsResponse requestTickets(Long bookingId, RequestTicketsRequest body) { + try (OracleConnection conn = (OracleConnection) connectionPool.getConnection(); + AutoCloseable suspend = conn::suspendTransaction;) { + conn.setAutoCommit(false); + + conn.resumeTransaction(Util.hexToByteArray(body.transactionId())); + + List seats = lockAndBookSeats(conn, bookingId, body.flightId(), body.count()); + + return new RequestTicketsResponse(seats.size(), seats); + } catch (SQLException ex) { + if (ex.getErrorCode() == TRANSACTION_NOT_FOUND_ERROR) { + throw new TransactionNotFoundException(body.transactionId()); + } + throw new UnexpectedException(ex); + } catch (APIException ex) { + throw ex; + } catch (Exception ex) { + throw new UnexpectedException(ex); + } + } + + public void removeTicket(Long bookingId, Long seatId, String transactionId) { + try (OracleConnection conn = (OracleConnection) connectionPool.getConnection(); + AutoCloseable suspend = conn::suspendTransaction;) { + conn.setAutoCommit(false); + conn.resumeTransaction(Util.hexToByteArray(transactionId)); + + removeTicket(conn, seatId, bookingId); + } catch (SQLException ex) { + if (ex.getErrorCode() == TRANSACTION_NOT_FOUND_ERROR) { + throw new TransactionNotFoundException(transactionId); + } + throw new UnexpectedException(ex); + } catch (APIException ex) { + throw ex; + } catch (Exception ex) { + throw new UnexpectedException(ex); + } + } + + public CheckoutResponse checkout(Long bookingId, CheckoutRequest checkoutDetails) { + float sum; + byte[] gtrid = Util.hexToByteArray(checkoutDetails.transactionId()); + String receipt; + List tickets; + + try (OracleConnection conn = (OracleConnection) connectionPool.getConnection();) { + conn.setAutoCommit(false); + conn.resumeTransaction(gtrid); + try { + tickets = getTickets(conn, bookingId); + sum = tickets.stream().map(CheckoutResponse.TicketDTO::price).reduce(0F, Float::sum); + receipt = paymentService.pay(sum, checkoutDetails.paymentMethod()); + saveReceipt(conn, receipt, sum, bookingId, checkoutDetails.paymentMethod()); + } catch (Exception ex) { + conn.suspendTransaction(); + throw ex; + } + conn.commit(); + } catch (SQLException ex) { + if (ex.getErrorCode() == TRANSACTION_NOT_FOUND_ERROR) { + throw new TransactionNotFoundException(checkoutDetails.transactionId()); + } + throw new UnexpectedException(ex); + } catch (APIException ex) { + throw ex; + } catch (Exception ex) { + throw new UnexpectedException(ex); + } + + return new CheckoutResponse(bookingId, tickets, sum, receipt, checkoutDetails.paymentMethod()); + } + + public void cancelBooking(String transactionId) { + try (OracleConnection conn = (OracleConnection) connectionPool.getConnection();) { + conn.setAutoCommit(false); + conn.resumeTransaction(Util.hexToByteArray(transactionId)); + conn.rollback(); + } catch (SQLException ex) { + if (ex.getErrorCode() == TRANSACTION_NOT_FOUND_ERROR) { + throw new TransactionNotFoundException(transactionId); + } + throw new UnexpectedException(ex); + } catch (APIException ex) { + throw ex; + } catch (Exception ex) { + throw new UnexpectedException(ex); + } + } + + private List lockAndBookSeats(OracleConnection conn, long bookingId, long flightId, int count) + throws SQLException, NoFreeSeatFoundException, BookingNotFoundException { + Savepoint sp1 = conn.setSavepoint(); + try { + List seats = getFreeSeats(conn, flightId, count); + if (seats.isEmpty()) { + throw new NoFreeSeatFoundException(flightId); + } + for (Long seatId : seats) { + addTicket(conn, seatId, bookingId); + } + return seats; + } catch (BookingNotFoundException ex) { + conn.rollback(sp1); + throw ex; + } + } + + private void saveReceipt(OracleConnection conn, String receiptNumber, double sum, long bookingId, long paymentMethodId) + throws SQLException { + final String saveReceiptDML = """ + INSERT INTO receipts (created_at, receipt_number, total, booking_id, payment_method_id) values (?, ?, ?, ?, ?); + """; + + try (OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement(saveReceiptDML)) { + stmt.setTimestamp(1, new Timestamp(System.currentTimeMillis())); + stmt.setString(2, receiptNumber); + stmt.setDouble(3, sum); + stmt.setLong(4, bookingId); + stmt.setLong(5, paymentMethodId); + stmt.execute(); + } catch (SQLException ex) { + if (ex.getErrorCode() == INTEGRITY_CONSTRAINT_ERROR) { + throw new BookingNotFoundException(bookingId); + } + throw ex; + } + } + + private void addTicket(Connection conn, long seatId, long bookingId) + throws SQLException, BookingNotFoundException { + final String saveTicketDML = "INSERT INTO tickets (seat_id, booking_id) VALUES (?, ?)"; + try (PreparedStatement stmt = conn.prepareStatement(saveTicketDML)) { + stmt.setLong(1, seatId); + stmt.setLong(2, bookingId); + stmt.execute(); + } catch (SQLException ex) { + if (ex.getErrorCode() == INTEGRITY_CONSTRAINT_ERROR) { + throw new BookingNotFoundException(bookingId); + } + throw ex; + } + + final String updateSeatDML = "UPDATE seats SET available=FALSE WHERE id = ?"; + try(PreparedStatement stmt = conn.prepareStatement(updateSeatDML)) { + stmt.setLong(1, seatId); + stmt.execute(); + } + } + + private void removeTicket(OracleConnection conn, long seatId, long bookingId) + throws SQLException, NoTicketFoundException { + final String deleteTicketDML = "DELETE FROM tickets WHERE seat_id = ? AND booking_id = ?"; + try (PreparedStatement stmt = conn.prepareStatement(deleteTicketDML)) { + stmt.setLong(1, seatId); + stmt.setLong(2, bookingId); + if (stmt.executeUpdate() == 0) { + throw new NoTicketFoundException(seatId, bookingId); + } + } + + final String updateSeatDML = "UPDATE seats SET available=TRUE WHERE id = ?"; + try (PreparedStatement stmt = conn.prepareStatement(updateSeatDML)) { + stmt.setLong(1, seatId); + stmt.executeUpdate(); + } + } + + /** + * Get free tickets from the database and lock them. + * + * @param conn db connection. + * @param flightId flight ID. + * @param count number of tickets to request. + * + * @return list of locked tickets, list size will be less or equal to {@code count} depending on the + * availability of the tickets in the database. + */ + private List getFreeSeats(OracleConnection conn, long flightId, int count) throws SQLException { + final String getFreeSeatsQuery = """ + SELECT id FROM seats + WHERE available = true AND flight_id = ? + FETCH FIRST ? ROW ONLY + FOR UPDATE SKIP LOCKED;"""; + + List seats = new ArrayList<>(); + + try(PreparedStatement stmt = conn.prepareStatement(getFreeSeatsQuery);) { + stmt.setLong(1, flightId); + stmt.setInt(2, count); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + seats.add(rs.getLong(1)); + } + } + + return seats; + } + + private long createBooking(OracleConnection conn) throws SQLException { + final String createBookingDML = "INSERT INTO bookings (created_at) VALUES (NULL) RETURNING ID INTO ?"; + try (OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement(createBookingDML)) { + stmt.registerReturnParameter(1, java.sql.Types.NUMERIC); + stmt.execute(); + ResultSet rs = stmt.getReturnResultSet(); + + rs.next(); + return rs.getLong(1); + } + } + + + private List getTickets(OracleConnection conn, long bookingId) throws SQLException { + final String ticketsQuery = """ + SELECT t1.seat_id, t2.flight_id, t3.price + FROM tickets t1 + JOIN seats t2 ON t1.seat_id = t2.id + JOIN flights t3 ON t2.flight_id = t3.id + WHERE t1.booking_id = ? + """; + List tickets = new ArrayList<>(); + + try (PreparedStatement stmt = conn.prepareStatement(ticketsQuery)) { + stmt.setLong(1, bookingId); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + tickets.add(new CheckoutResponse.TicketDTO(rs.getLong(1), rs.getLong(2), rs.getFloat(3))); + } + } + + return tickets; + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/PaymentService.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/PaymentService.java new file mode 100644 index 00000000..4dfb13f8 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/PaymentService.java @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.service; + +import com.oracle.jdbc.samples.sessionlesstxns.exception.PaymentFailedException; +import org.springframework.stereotype.Service; + +@Service +public interface PaymentService { + + /** + * @param sum + * @param paymentMethodId + * @return receipt number. + */ + String pay(double sum, long paymentMethodId) throws PaymentFailedException; +} diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/util/Util.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/util/Util.java new file mode 100644 index 00000000..071cc653 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/util/Util.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns.util; + +public class Util { + public static String byteArrayToHex(byte[] a) { + if (a == null) return null; + + StringBuilder sb = new StringBuilder(a.length * 2); + for(byte b: a) + sb.append(String.format("%02x", b)); + return sb.toString().toUpperCase(); + } + + public static byte[] hexToByteArray(String s) { + int size = s.length(); + if (size % 2 != 0) { + throw new IllegalArgumentException("String must have an even number of characters"); + } + + byte[] array = new byte[size / 2]; + for (int i = 0; i < size; i += 2) { + array[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i+1), 16)); + } + + return array; + } +} diff --git a/java/jdbc/SessionlessTransactions/src/main/resources/application.properties b/java/jdbc/SessionlessTransactions/src/main/resources/application.properties new file mode 100644 index 00000000..ff86b29d --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/main/resources/application.properties @@ -0,0 +1,17 @@ +# +# Copyright (c) 2021 Oracle, Inc. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ +# + +# Configuring UCP datasource +spring.datasource.url=${DATABASE_URL} +spring.datasource.username=${DATABASE_USERNAME} +spring.datasource.password=${DATABASE_PASSWORD} +spring.datasource.driver-class-name=oracle.jdbc.OracleDriver +spring.datasource.type=oracle.ucp.jdbc.PoolDataSource +spring.datasource.oracleucp.connection-factory-class-name=oracle.jdbc.pool.OracleDataSource +spring.datasource.oracleucp.sql-for-validate-connection=select * from dual +spring.datasource.oracleucp.connection-pool-name=connectionPoolName1 +spring.datasource.oracleucp.initial-pool-size=15 +spring.datasource.oracleucp.min-pool-size=5 +spring.datasource.oracleucp.max-pool-size=30 diff --git a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java new file mode 100644 index 00000000..527cceaf --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns; + +import com.oracle.jdbc.samples.sessionlesstxns.exception.PaymentFailedException; +import com.oracle.jdbc.samples.sessionlesstxns.service.PaymentService; +import org.junit.jupiter.api.*; +import org.mockito.Mockito; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Primary; +import org.springframework.http.HttpStatus; + +public class TestApis extends TestBase { + + static final long FLIGHT1_ID = 0; + static final int FLIGHT1_AVAILABLE_SEATS = 1; + static final long FLIGHT1_PRICE = 1000; + static final long FLIGHT2_ID = 1; + static final long FLIGHT2_PRICE = 2300; + static final long FLIGHT3_ID = 2; + static final long PAYMENT_METHOD_ID = 0; + static final String DUMMY_RECEIPT_NUMBER = "1442AZ"; + static final int DEFAULT_TIMEOUT = 1; + + @BeforeEach + void updateData() { + cleanTables(); + loadData(); + } + + static protected PaymentService paymentService = Mockito.mock(PaymentService.class); + + @TestConfiguration + static class TestConfig { + @Bean + @Primary + public PaymentService paymentService() { + return paymentService; + } + } + + /** + * Test following scenario: + * + * 1. Start a transaction. + * 2. Add 1 ticket of flight 1. + * 3. Add 2 tickets of flight 2. + * 4. Checkout. + */ + @Test + void testNormalScenario() { + Mockito.when(paymentService.pay(Mockito.anyDouble(),Mockito.eq(PAYMENT_METHOD_ID))) + .thenReturn(DUMMY_RECEIPT_NUMBER); + + final int FLIGHT1_REQUESTED_SEATS = 1; + var startTransaction = testAPIStartTransaction(DEFAULT_TIMEOUT, FLIGHT1_ID, FLIGHT1_REQUESTED_SEATS, HttpStatus.CREATED); + + Assertions.assertNotNull(startTransaction); + Assertions.assertNotNull(startTransaction.bookingId()); + Assertions.assertEquals(FLIGHT1_REQUESTED_SEATS, startTransaction.count()); + Assertions.assertEquals(FLIGHT1_REQUESTED_SEATS, startTransaction.seatIds().size()); + + final int FLIGHT2_REQUESTED_SEATS = 2; + var requestTickets = testAPIRequestTickets( + startTransaction.transactionId(), FLIGHT2_ID, FLIGHT2_REQUESTED_SEATS, startTransaction.bookingId(), HttpStatus.CREATED); + + Assertions.assertNotNull(requestTickets); + Assertions.assertEquals(FLIGHT2_REQUESTED_SEATS, requestTickets.count()); + Assertions.assertEquals(FLIGHT2_REQUESTED_SEATS, requestTickets.seatIds().size()); + + var checkout = testAPICheckout(startTransaction.transactionId(), PAYMENT_METHOD_ID, startTransaction.bookingId(), HttpStatus.CREATED); + + Assertions.assertNotNull(checkout); + Assertions.assertEquals(FLIGHT1_REQUESTED_SEATS * FLIGHT1_PRICE + FLIGHT2_REQUESTED_SEATS * FLIGHT2_PRICE, checkout.total()); + Assertions.assertEquals(PAYMENT_METHOD_ID, checkout.paymentMethod()); + Assertions.assertEquals(DUMMY_RECEIPT_NUMBER, checkout.receiptNumber()); + Assertions.assertNotNull(checkout.tickets()); + Assertions.assertEquals(FLIGHT1_REQUESTED_SEATS + FLIGHT2_REQUESTED_SEATS, checkout.tickets().size()); + + final String queryBookingOrder = "SELECT id FROM bookings WHERE id = ?"; + Assertions.assertNotNull(jdbcTemplate.queryForObject(queryBookingOrder, Long.class, startTransaction.bookingId())); + } + + /** + * Test following scenario: + * - Add 2 tickets of flight 1 (only one found) + * - Add 1 tickets of flight 3 (not free seat found) + * - cancel booking + */ + @Test + void secondScenario() { + final int FLIGHT1_REQUESTED_SEATS = 2; + var startTransaction = testAPIStartTransaction(DEFAULT_TIMEOUT, FLIGHT1_ID, FLIGHT1_REQUESTED_SEATS, HttpStatus.PARTIAL_CONTENT); + + Assertions.assertNotNull(startTransaction); + Assertions.assertNotNull(startTransaction.bookingId()); + Assertions.assertEquals(FLIGHT1_AVAILABLE_SEATS, startTransaction.count()); + Assertions.assertEquals(FLIGHT1_AVAILABLE_SEATS, startTransaction.seatIds().size()); + + final int FLIGHT3_REQUESTED_SEATS = 1; + testAPIRequestTickets(startTransaction.transactionId(), FLIGHT3_ID, FLIGHT3_REQUESTED_SEATS, startTransaction.bookingId(), HttpStatus.NOT_FOUND); + + testAPICancelBooking(startTransaction.transactionId(), HttpStatus.OK); + } + + /** + * Test following scenario: + * - Request 2 seats of flight 2 + * - Checkout (payment fails) + * - Remove ticket of flight 2 + * - Checkout (payment succeeds) + */ + @Test + void thirdScenario() { + Mockito.when(paymentService.pay(Mockito.anyDouble(),Mockito.eq(PAYMENT_METHOD_ID))).thenAnswer(invocation -> { + double sum = invocation.getArgument(0); + if (sum > FLIGHT2_PRICE) { + throw new PaymentFailedException(); + } + return DUMMY_RECEIPT_NUMBER; + }); + + final int FLIGHT2_REQUESTED_SEATS = 2; + var startTransaction = testAPIStartTransaction(DEFAULT_TIMEOUT, FLIGHT2_ID, FLIGHT2_REQUESTED_SEATS, HttpStatus.CREATED); + + testAPICheckout(startTransaction.transactionId(), PAYMENT_METHOD_ID, startTransaction.bookingId(), HttpStatus.PAYMENT_REQUIRED); + + final long SEAT_ID_TO_CANCEL = startTransaction.seatIds().get(0); + testAPIRemoveTicket(startTransaction.transactionId(), startTransaction.bookingId(), SEAT_ID_TO_CANCEL, HttpStatus.OK); + + final int NEW_REQUESTED_SEATS_COUNT = FLIGHT2_REQUESTED_SEATS - 1; + var checkout = testAPICheckout(startTransaction.transactionId(), PAYMENT_METHOD_ID, startTransaction.bookingId(), HttpStatus.CREATED); + + Assertions.assertNotNull(checkout); + Assertions.assertEquals(NEW_REQUESTED_SEATS_COUNT * FLIGHT2_PRICE, checkout.total()); + Assertions.assertEquals(DUMMY_RECEIPT_NUMBER, checkout.receiptNumber()); + Assertions.assertNotNull(checkout.tickets()); + Assertions.assertEquals(NEW_REQUESTED_SEATS_COUNT, checkout.tickets().size()); + Assertions.assertTrue(checkout.tickets().stream().noneMatch(ticket -> ticket.seatId().equals(SEAT_ID_TO_CANCEL))); + } + + private void loadData() { + runSQLScript("dataLoader.sql"); + } + + private void cleanTables() { + runSQLScript("dataCleaner.sql"); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java new file mode 100644 index 00000000..308c9a9b --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns; + +import com.oracle.jdbc.samples.sessionlesstxns.dto.CheckoutRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.CheckoutResponse; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RemoveTicketRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RequestTicketsRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.RequestTicketsResponse; +import com.oracle.jdbc.samples.sessionlesstxns.dto.StartTransactionRequest; +import com.oracle.jdbc.samples.sessionlesstxns.dto.StartTransactionResponse; +import io.restassured.RestAssured; +import io.restassured.http.ContentType; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.TestInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.http.HttpStatus; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.test.context.ActiveProfiles; + +import java.io.InputStream; +import java.util.List; +import java.util.Scanner; + +@ActiveProfiles("test") +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public class TestBase { + static { + RestAssured.baseURI = "http://127.0.0.1"; + } + + @LocalServerPort + private int port; + + + @Autowired + protected JdbcTemplate jdbcTemplate; + + @BeforeAll + void setUp() { + RestAssured.port = port; + createSchema(); + } + + @AfterAll + void tearDown() { + dropSchema(); + } + + public void runSQLScript(String fileName) { + InputStream inputStream = TestBase.class.getClassLoader().getResourceAsStream(fileName); + List instructions = new Scanner(inputStream).useDelimiter(";").tokens().toList(); + jdbcTemplate.batchUpdate(instructions.toArray(new String[0])); + } + + public static StartTransactionResponse testAPIStartTransaction(int timeout, long flightId, int count, HttpStatus expectedStatus) { + var request = RestAssured.given() + .contentType(ContentType.JSON) + .body(new StartTransactionRequest(timeout, flightId, count)) + .when() + .post("/api/v1/bookings"); + + if (expectedStatus.equals(HttpStatus.CREATED) || expectedStatus.equals(HttpStatus.PARTIAL_CONTENT)) { + return request + .then() + .statusCode(expectedStatus.value()) + .and() + .extract() + .response() + .body().as(StartTransactionResponse.class); + } + + request.then().statusCode(expectedStatus.value()); + return null; + } + + public static RequestTicketsResponse testAPIRequestTickets( + String transactionId, long flightId, int count, long bookingId, HttpStatus expectedStatus) { + var request = RestAssured.given() + .contentType(ContentType.JSON) + .body(new RequestTicketsRequest(transactionId, flightId, count)) + .pathParam("bookingId", bookingId) + .when() + .post("/api/v1/bookings/{bookingId}"); + + + if (expectedStatus.equals(HttpStatus.CREATED) || expectedStatus.equals(HttpStatus.PARTIAL_CONTENT)) { + return request + .then() + .statusCode(expectedStatus.value()) + .and() + .extract() + .response() + .body().as(RequestTicketsResponse.class); + } + + request.then().statusCode(expectedStatus.value()); + return null; + } + + public void testAPIRemoveTicket(String transactionId, long bookingId, long seatId, HttpStatus expectedStatus) { + RestAssured.given() + .contentType(ContentType.JSON) + .body(new RemoveTicketRequest(transactionId, seatId)) + .pathParams("bookingId", bookingId) + .when() + .delete("/api/v1/bookings/{bookingId}") + .then() + .statusCode(expectedStatus.value()); + } + + public static CheckoutResponse testAPICheckout( + String transactionId, long paymentMethodId, long bookingId, HttpStatus expectedStatus) { + var request = RestAssured.given() + .contentType(ContentType.JSON) + .body(new CheckoutRequest(transactionId, paymentMethodId)) + .pathParam("bookingId", bookingId) + .when() + .post("/api/v1/bookings/{bookingId}/checkout"); + + if (expectedStatus.equals(HttpStatus.CREATED)) { + return request + .then() + .statusCode(HttpStatus.CREATED.value()) + .and() + .extract() + .response() + .body().as(CheckoutResponse.class); + } + + request.then().statusCode(expectedStatus.value()); + return null; + } + + public void testAPICancelBooking(String transactionId, HttpStatus expectedStatus) { + RestAssured.given() + .contentType(ContentType.JSON) + .pathParam("transactionId", transactionId) + .when() + .post("/api/v1/bookings/cancel/{transactionId}") + .then().statusCode(expectedStatus.value()); + } + + private void createSchema() { + runSQLScript("createSchema.sql"); + } + + private void dropSchema() { + runSQLScript("dropSchema.sql"); + } +} diff --git a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java new file mode 100644 index 00000000..65851144 --- /dev/null +++ b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2025 Oracle, Inc. + * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ + */ + +package com.oracle.jdbc.samples.sessionlesstxns; + + +import com.oracle.jdbc.samples.sessionlesstxns.service.PaymentService; +import org.junit.jupiter.api.*; +import org.mockito.Mockito; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Primary; +import org.springframework.http.HttpStatus; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +public class TestConcurrency extends TestBase { + + private static final Logger logger = LoggerFactory.getLogger(TestConcurrency.class); + + static final long FLIGHT1_ID = 0; + static final long FLIGHT1_PRICE = 1000; + static final long PAYMENT_METHOD_ID = 0; + static final String DUMMY_RECEIPT_NUMBER = "1442AZ"; + static final int DEFAULT_TIMEOUT = 1; + + @BeforeEach + void updateData() { + cleanTables(); + loadData(); + Mockito.when(paymentService.pay(Mockito.anyDouble(),Mockito.eq(PAYMENT_METHOD_ID))) + .thenReturn(DUMMY_RECEIPT_NUMBER); + } + + static protected PaymentService paymentService = Mockito.mock(PaymentService.class); + + @TestConfiguration + static class TestConfig { + @Bean + @Primary + public PaymentService paymentService() { + return paymentService; + } + } + + @Test + void testNormalScenario() { + Runnable test = () -> { + try { + testScenario(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }; + + long start = System.currentTimeMillis(); + + final int numberOfExecutions = 50; + try (ExecutorService exService = Executors.newFixedThreadPool(numberOfExecutions)) { + for (int i=0; i Date: Tue, 3 Jun 2025 00:51:10 +0100 Subject: [PATCH 33/37] Sessionless txns demo updates (#443) * Fix concurrency tests * Use a stored procedure to query and lock seats * Give user create procedure privilidge * Remove semicolon from query * replace 1 with true --- .../service/BookingService.java | 33 ++++++++++++------- .../samples/sessionlesstxns/TestApis.java | 4 +-- .../samples/sessionlesstxns/TestBase.java | 14 +++++--- .../sessionlesstxns/TestConcurrency.java | 24 +++++++++++--- .../src/test/resources/application.properties | 3 +- .../src/test/resources/createSchema.sql | 27 +++++++++++---- .../src/test/resources/createUser.sql | 1 + .../src/test/resources/dropSchema.sql | 1 + 8 files changed, 76 insertions(+), 31 deletions(-) diff --git a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java index be0feb0f..2fddd8e6 100644 --- a/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java +++ b/java/jdbc/SessionlessTransactions/src/main/java/com/oracle/jdbc/samples/sessionlesstxns/service/BookingService.java @@ -20,9 +20,13 @@ import com.oracle.jdbc.samples.sessionlesstxns.util.Util; import oracle.jdbc.OracleConnection; import oracle.jdbc.OraclePreparedStatement; +import oracle.jdbc.OracleTypes; import org.springframework.stereotype.Service; import javax.sql.DataSource; +import java.math.BigDecimal; +import java.sql.Array; +import java.sql.CallableStatement; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -30,6 +34,7 @@ import java.sql.Savepoint; import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; @Service @@ -175,7 +180,7 @@ private List lockAndBookSeats(OracleConnection conn, long bookingId, long private void saveReceipt(OracleConnection conn, String receiptNumber, double sum, long bookingId, long paymentMethodId) throws SQLException { final String saveReceiptDML = """ - INSERT INTO receipts (created_at, receipt_number, total, booking_id, payment_method_id) values (?, ?, ?, ?, ?); + INSERT INTO receipts (created_at, receipt_number, total, booking_id, payment_method_id) values (?, ?, ?, ?, ?) """; try (OraclePreparedStatement stmt = (OraclePreparedStatement) conn.prepareStatement(saveReceiptDML)) { @@ -243,20 +248,24 @@ private void removeTicket(OracleConnection conn, long seatId, long bookingId) * availability of the tickets in the database. */ private List getFreeSeats(OracleConnection conn, long flightId, int count) throws SQLException { - final String getFreeSeatsQuery = """ - SELECT id FROM seats - WHERE available = true AND flight_id = ? - FETCH FIRST ? ROW ONLY - FOR UPDATE SKIP LOCKED;"""; + final String procedureCall = "{call fetch_seats(?, ?, ?)}"; + List seats = null; - List seats = new ArrayList<>(); - - try(PreparedStatement stmt = conn.prepareStatement(getFreeSeatsQuery);) { + try (CallableStatement stmt = conn.prepareCall(procedureCall)) { + // Set input parameters stmt.setLong(1, flightId); stmt.setInt(2, count); - ResultSet rs = stmt.executeQuery(); - while (rs.next()) { - seats.add(rs.getLong(1)); + // Register the OUT parameter (Oracle NUMBER_TABLE) + stmt.registerOutParameter(3, OracleTypes.ARRAY, "DBMS_SQL.NUMBER_TABLE"); + // Execute the procedure + stmt.execute(); + + // Retrieve the results + Array resultArray = stmt.getArray(3); + + if (resultArray != null) { + seats = Arrays.stream((BigDecimal[]) resultArray.getArray()).map(BigDecimal::longValue).toList(); + resultArray.free(); } } diff --git a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java index 527cceaf..9e5f36b6 100644 --- a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java +++ b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestApis.java @@ -144,10 +144,10 @@ void thirdScenario() { } private void loadData() { - runSQLScript("dataLoader.sql"); + runSQLScript("dataLoader.sql", ";"); } private void cleanTables() { - runSQLScript("dataCleaner.sql"); + runSQLScript("dataCleaner.sql", ";"); } } diff --git a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java index 308c9a9b..8eba61b1 100644 --- a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java +++ b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestBase.java @@ -25,6 +25,10 @@ import org.springframework.test.context.ActiveProfiles; import java.io.InputStream; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; import java.util.List; import java.util.Scanner; @@ -54,10 +58,10 @@ void tearDown() { dropSchema(); } - public void runSQLScript(String fileName) { + public void runSQLScript(String fileName, String delimiter) { InputStream inputStream = TestBase.class.getClassLoader().getResourceAsStream(fileName); - List instructions = new Scanner(inputStream).useDelimiter(";").tokens().toList(); - jdbcTemplate.batchUpdate(instructions.toArray(new String[0])); + List instructions = new Scanner(inputStream).useDelimiter(delimiter).tokens().toList(); + jdbcTemplate.batchUpdate(instructions.toArray(new String[0])); } public static StartTransactionResponse testAPIStartTransaction(int timeout, long flightId, int count, HttpStatus expectedStatus) { @@ -149,10 +153,10 @@ public void testAPICancelBooking(String transactionId, HttpStatus expectedStatus } private void createSchema() { - runSQLScript("createSchema.sql"); + runSQLScript("createSchema.sql", ";/"); } private void dropSchema() { - runSQLScript("dropSchema.sql"); + runSQLScript("dropSchema.sql", ";"); } } diff --git a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java index 65851144..6dbc112d 100644 --- a/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java +++ b/java/jdbc/SessionlessTransactions/src/test/java/com/oracle/jdbc/samples/sessionlesstxns/TestConcurrency.java @@ -16,8 +16,12 @@ import org.springframework.context.annotation.Primary; import org.springframework.http.HttpStatus; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.Future; public class TestConcurrency extends TestBase { @@ -62,10 +66,20 @@ void testNormalScenario() { final int numberOfExecutions = 50; try (ExecutorService exService = Executors.newFixedThreadPool(numberOfExecutions)) { - for (int i=0; i> futures = new ArrayList<>(); + for (int i = 0; i < numberOfExecutions; i++) { + futures.add(exService.submit(test)); + } + // Wait for all tasks to complete + for (Future future : futures) { + try { + future.get(); // This blocks until the task completes + } catch (InterruptedException | ExecutionException e) { + logger.error("Task execution failed", e); + } } } + logger.info("Execution time: {} s", (System.currentTimeMillis() - start) / 1_000); } @@ -79,7 +93,7 @@ void testScenario() throws InterruptedException { Assertions.assertEquals(REQUESTED_SEATS1, startTransaction.seatIds().size()); Thread.sleep(1000); - final int REQUESTED_SEATS2 = 2; + final int REQUESTED_SEATS2 = 1; var requestTickets = testAPIRequestTickets( startTransaction.transactionId(), FLIGHT1_ID, REQUESTED_SEATS2, startTransaction.bookingId(), HttpStatus.CREATED); @@ -102,10 +116,10 @@ void testScenario() throws InterruptedException { } private void loadData() { - runSQLScript("hundredsSeats.sql"); + runSQLScript("hundredsSeats.sql", ";"); } private void cleanTables() { - runSQLScript("dataCleaner.sql"); + runSQLScript("dataCleaner.sql", ";"); } } diff --git a/java/jdbc/SessionlessTransactions/src/test/resources/application.properties b/java/jdbc/SessionlessTransactions/src/test/resources/application.properties index 4ca5ec01..b0960c3f 100644 --- a/java/jdbc/SessionlessTransactions/src/test/resources/application.properties +++ b/java/jdbc/SessionlessTransactions/src/test/resources/application.properties @@ -14,4 +14,5 @@ spring.datasource.oracleucp.sql-for-validate-connection=select * from dual spring.datasource.oracleucp.connection-pool-name=connectionPool-${random.uuid} spring.datasource.oracleucp.initial-pool-size=5 spring.datasource.oracleucp.min-pool-size=1 -spring.datasource.oracleucp.max-pool-size=10 \ No newline at end of file +spring.datasource.oracleucp.max-pool-size=10 +spring.datasource.oracleucp.connection-wait-timeout=120 \ No newline at end of file diff --git a/java/jdbc/SessionlessTransactions/src/test/resources/createSchema.sql b/java/jdbc/SessionlessTransactions/src/test/resources/createSchema.sql index 47ea77a8..09b2614f 100644 --- a/java/jdbc/SessionlessTransactions/src/test/resources/createSchema.sql +++ b/java/jdbc/SessionlessTransactions/src/test/resources/createSchema.sql @@ -7,7 +7,7 @@ CREATE TABLE bookings ( id NUMBER GENERATED ALWAYS AS IDENTITY, created_at DATE, CONSTRAINT BOOKING_PK PRIMARY KEY (id) -); +);/ CREATE TABLE flights ( id NUMBER, @@ -17,7 +17,7 @@ CREATE TABLE flights ( departure TIMESTAMP, price NUMBER, CONSTRAINT FLIGHT_PK PRIMARY KEY (id) -); +);/ CREATE TABLE seats ( id NUMBER, @@ -25,7 +25,7 @@ CREATE TABLE seats ( available BOOLEAN NOT NULL, CONSTRAINT SEAT_PK PRIMARY KEY (id), CONSTRAINT SEAT_FLIGHT_FK FOREIGN KEY (flight_id) REFERENCES flights(id) -); +);/ CREATE TABLE tickets ( id NUMBER GENERATED ALWAYS AS IDENTITY, @@ -34,12 +34,12 @@ CREATE TABLE tickets ( CONSTRAINT TICKET_PK PRIMARY KEY (id), CONSTRAINT TICKET_SEATS_FK FOREIGN KEY (seat_id) REFERENCES seats(id), CONSTRAINT TICKET_BOOKINGS_FK FOREIGN KEY (booking_id) REFERENCES bookings(id) -); +);/ CREATE TABLE payment_methods ( id NUMBER, CONSTRAINT PAYMENT_METHOD_PK PRIMARY KEY (id) -); +);/ CREATE TABLE receipts ( id NUMBER GENERATED ALWAYS AS IDENTITY, @@ -51,4 +51,19 @@ CREATE TABLE receipts ( CONSTRAINT RECEIPT_PK PRIMARY KEY (id), CONSTRAINT RECEIPT_BOOKING_FK FOREIGN KEY (booking_id) REFERENCES bookings(id), CONSTRAINT RECEIPT_PAYMENT_M_FK FOREIGN KEY (payment_method_id) REFERENCES payment_methods(id) -); \ No newline at end of file +);/ + +CREATE OR REPLACE PROCEDURE fetch_seats( + f_id IN NUMBER, + n_rows IN INT, + t_data OUT DBMS_SQL.NUMBER_TABLE +) AS + CURSOR c IS + SELECT id FROM seats + WHERE available = true AND flight_id = f_id + FOR UPDATE SKIP LOCKED; +BEGIN + OPEN c; + FETCH c BULK COLLECT INTO t_data LIMIT n_rows; + CLOSE c; +END fetch_seats; \ No newline at end of file diff --git a/java/jdbc/SessionlessTransactions/src/test/resources/createUser.sql b/java/jdbc/SessionlessTransactions/src/test/resources/createUser.sql index dd442b15..a2d774cf 100644 --- a/java/jdbc/SessionlessTransactions/src/test/resources/createUser.sql +++ b/java/jdbc/SessionlessTransactions/src/test/resources/createUser.sql @@ -8,4 +8,5 @@ GRANT CREATE SESSION TO test_user; GRANT CREATE TABLE TO test_user; GRANT CREATE SEQUENCE TO test_user; GRANT DROP ANY TABLE TO test_user; +GRANT CREATE PROCEDURE to test_user; GRANT UNLIMITED TABLESPACE TO test_user; \ No newline at end of file diff --git a/java/jdbc/SessionlessTransactions/src/test/resources/dropSchema.sql b/java/jdbc/SessionlessTransactions/src/test/resources/dropSchema.sql index 8a4849ea..dc0d21e5 100644 --- a/java/jdbc/SessionlessTransactions/src/test/resources/dropSchema.sql +++ b/java/jdbc/SessionlessTransactions/src/test/resources/dropSchema.sql @@ -3,6 +3,7 @@ * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ */ +DROP PROCEDURE fetch_seats; DROP TABLE receipts; DROP TABLE payment_methods; DROP TABLE tickets; From 6c60bfb886312088121b26ce01de01a6625f2c03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:53:21 -0700 Subject: [PATCH 34/37] Bump path-to-regexp and express (#438) Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.12 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together. Updates `path-to-regexp` from 0.1.10 to 0.1.12 - [Release notes](https://github.com/pillarjs/path-to-regexp/releases) - [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md) - [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.10...v0.1.12) Updates `express` from 4.21.1 to 4.21.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md) - [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2) --- updated-dependencies: - dependency-name: path-to-regexp dependency-type: indirect - dependency-name: express dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gerald Venzl --- .../hr_app/package-lock.json | 620 ++++++++++++------ .../hr_app/package.json | 2 +- 2 files changed, 432 insertions(+), 190 deletions(-) diff --git a/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json b/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json index 5b75f660..90c0ff2e 100644 --- a/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json +++ b/javascript/rest-api/part-1-web-server-basics/hr_app/package-lock.json @@ -1,36 +1,50 @@ { "name": "hr_app", "version": "0.1.1", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "accepts": { + "packages": { + "": { + "version": "0.1.1", + "license": "Apache-2.0", + "dependencies": { + "express": "^4.21.2", + "morgan": "^1.9.1" + } + }, + "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { + "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" } }, - "array-flatten": { + "node_modules/array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, - "basic-auth": { + "node_modules/basic-auth": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "requires": { + "dependencies": { "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" } }, - "body-parser": { + "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "requires": { + "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", @@ -44,130 +58,191 @@ "type-is": "~1.6.18", "unpipe": "1.0.0" }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "bytes": { + "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "engines": { + "node": ">= 0.8" + } }, - "call-bind": { + "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "content-disposition": { + "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { + "dependencies": { "safe-buffer": "5.2.1" }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" - } + "engines": { + "node": ">= 0.6" } }, - "content-type": { + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "engines": { + "node": ">= 0.6" + } }, - "cookie": { + "node_modules/cookie": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==" + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "engines": { + "node": ">= 0.6" + } }, - "cookie-signature": { + "node_modules/cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, - "debug": { + "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { + "dependencies": { "ms": "2.0.0" } }, - "define-data-property": { + "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "depd": { + "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" + } }, - "destroy": { + "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } }, - "ee-first": { + "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, - "encodeurl": { + "node_modules/encodeurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "engines": { + "node": ">= 0.8" + } }, - "es-define-property": { + "node_modules/es-define-property": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "requires": { + "dependencies": { "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" } }, - "es-errors": { + "node_modules/es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } }, - "escape-html": { + "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" }, - "etag": { + "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "engines": { + "node": ">= 0.6" + } }, - "express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", - "requires": { + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", + "license": "MIT", + "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", @@ -187,7 +262,7 @@ "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", + "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", @@ -200,27 +275,49 @@ "utils-merge": "1.0.1", "vary": "~1.1.2" }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } - } + ] }, - "finalhandler": { + "node_modules/finalhandler": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "requires": { + "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", @@ -229,246 +326,354 @@ "statuses": "2.0.1", "unpipe": "~1.0.0" }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "forwarded": { + "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "engines": { + "node": ">= 0.6" + } }, - "fresh": { + "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "engines": { + "node": ">= 0.6" + } }, - "function-bind": { + "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "get-intrinsic": { + "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "requires": { + "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "gopd": { + "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "requires": { + "dependencies": { "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-property-descriptors": { + "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "requires": { + "dependencies": { "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "has-proto": { + "node_modules/has-proto": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "has-symbols": { + "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "hasown": { + "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "requires": { + "dependencies": { "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" } }, - "http-errors": { + "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "requires": { + "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" } }, - "iconv-lite": { + "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { + "dependencies": { "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" } }, - "inherits": { + "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ipaddr.js": { + "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "engines": { + "node": ">= 0.10" + } }, - "media-typer": { + "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "engines": { + "node": ">= 0.6" + } }, - "merge-descriptors": { + "node_modules/merge-descriptors": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==" + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "methods": { + "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "engines": { + "node": ">= 0.6" + } }, - "mime": { + "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } }, - "mime-db": { + "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } }, - "mime-types": { + "node_modules/mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { + "dependencies": { "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" } }, - "morgan": { + "node_modules/morgan": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", - "requires": { + "dependencies": { "basic-auth": "~2.0.1", "debug": "2.6.9", "depd": "~2.0.0", "on-finished": "~2.3.0", "on-headers": "~1.0.2" }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/morgan/node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "engines": { + "node": ">= 0.8" } }, - "ms": { + "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "negotiator": { + "node_modules/negotiator": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "engines": { + "node": ">= 0.6" + } }, - "object-inspect": { + "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "on-finished": { + "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { + "dependencies": { "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "on-headers": { + "node_modules/on-headers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "engines": { + "node": ">= 0.8" + } }, - "parseurl": { + "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } }, - "path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" }, - "proxy-addr": { + "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { + "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" } }, - "qs": { + "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "requires": { + "dependencies": { "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "range-parser": { + "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } }, - "raw-body": { + "node_modules/raw-body": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "requires": { + "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "safe-buffer": { + "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safer-buffer": { + "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "send": { + "node_modules/send": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "requires": { + "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -483,100 +688,137 @@ "range-parser": "~1.2.1", "statuses": "2.0.1" }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/send/node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dependencies": { - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "requires": { - "ee-first": "1.1.1" - } - } + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "serve-static": { + "node_modules/serve-static": { "version": "1.16.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "requires": { + "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "0.19.0" + }, + "engines": { + "node": ">= 0.8.0" } }, - "set-function-length": { + "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "requires": { + "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" } }, - "setprototypeof": { + "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" }, - "side-channel": { + "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "requires": { + "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.4", "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "statuses": { + "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "engines": { + "node": ">= 0.8" + } }, - "toidentifier": { + "node_modules/toidentifier": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "engines": { + "node": ">=0.6" + } }, - "type-is": { + "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { + "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" } }, - "unpipe": { + "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "engines": { + "node": ">= 0.8" + } }, - "utils-merge": { + "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "engines": { + "node": ">= 0.4.0" + } }, - "vary": { + "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "engines": { + "node": ">= 0.8" + } } } } diff --git a/javascript/rest-api/part-1-web-server-basics/hr_app/package.json b/javascript/rest-api/part-1-web-server-basics/hr_app/package.json index f53fc831..a2788ff6 100644 --- a/javascript/rest-api/part-1-web-server-basics/hr_app/package.json +++ b/javascript/rest-api/part-1-web-server-basics/hr_app/package.json @@ -9,7 +9,7 @@ "keywords": [], "license": "Apache-2.0", "dependencies": { - "express": "^4.21.1", + "express": "^4.21.2", "morgan": "^1.9.1" } } From 34b6fc161080807e46a2cf22d22546d84ed97296 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 3 Jun 2025 09:54:11 +1000 Subject: [PATCH 35/37] Add examples for python-oracledb 3.0 (#435) Signed-off-by: Christopher Jones Co-authored-by: Gerald Venzl --- python/python-oracledb/create_schema.py | 2 +- python/python-oracledb/dataframe_numpy.py | 71 +++++++ python/python-oracledb/dataframe_pandas.py | 102 +++++++++ .../python-oracledb/dataframe_pandas_async.py | 109 ++++++++++ .../dataframe_parquet_write.py | 87 ++++++++ python/python-oracledb/dataframe_polars.py | 96 +++++++++ python/python-oracledb/dataframe_pyarrow.py | 97 +++++++++ python/python-oracledb/dataframe_torch.py | 67 ++++++ python/python-oracledb/multi_consumer_aq.py | 56 +++-- python/python-oracledb/object_aq.py | 7 +- python/python-oracledb/pipelining_basic.py | 75 ++++++- python/python-oracledb/pipelining_error.py | 2 +- python/python-oracledb/plsql_batch.py | 193 +++++++++++++++++ python/python-oracledb/plsql_batch_async.py | 201 ++++++++++++++++++ python/python-oracledb/raw_aq.py | 46 ++-- python/python-oracledb/sql/create_schema.sql | 38 ++++ .../python-oracledb/sql/create_schema_23.sql | 11 +- python/python-oracledb/transaction_guard.py | 30 ++- python/python-oracledb/vector.py | 61 ++++-- python/python-oracledb/vector_async.py | 34 ++- 20 files changed, 1288 insertions(+), 97 deletions(-) create mode 100644 python/python-oracledb/dataframe_numpy.py create mode 100644 python/python-oracledb/dataframe_pandas.py create mode 100644 python/python-oracledb/dataframe_pandas_async.py create mode 100644 python/python-oracledb/dataframe_parquet_write.py create mode 100644 python/python-oracledb/dataframe_polars.py create mode 100644 python/python-oracledb/dataframe_pyarrow.py create mode 100644 python/python-oracledb/dataframe_torch.py create mode 100644 python/python-oracledb/plsql_batch.py create mode 100644 python/python-oracledb/plsql_batch_async.py diff --git a/python/python-oracledb/create_schema.py b/python/python-oracledb/create_schema.py index d2bc0997..409b367e 100644 --- a/python/python-oracledb/create_schema.py +++ b/python/python-oracledb/create_schema.py @@ -54,7 +54,7 @@ sample_env.run_sql_script( conn, "create_schema_21", main_user=sample_env.get_main_user() ) -if sample_env.get_server_version() >= (23, 5): +if sample_env.get_server_version() >= (23, 7): sample_env.run_sql_script( conn, "create_schema_23", main_user=sample_env.get_main_user() ) diff --git a/python/python-oracledb/dataframe_numpy.py b/python/python-oracledb/dataframe_numpy.py new file mode 100644 index 00000000..8bc7a476 --- /dev/null +++ b/python/python-oracledb/dataframe_numpy.py @@ -0,0 +1,71 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_numpy.py +# +# Shows how to use connection.fetch_df_all() to efficiently put data into a +# NumPy ndarray via the DLPack standard memory layout. +# ----------------------------------------------------------------------------- + +import pyarrow +import numpy + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +SQL = "select id from SampleQueryTab order by id" + +# Get an OracleDataFrame +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL, arraysize=100) + +# Convert to an ndarray via the Python DLPack specification +pyarrow_array = pyarrow.array(odf.get_column_by_name("ID")) +np = numpy.from_dlpack(pyarrow_array) + +# If the array has nulls, an alternative is: +# np = pyarrow_array.to_numpy(zero_copy_only=False) + +print("Type:") +print(type(np)) # + +# Perform various numpy operations on the ndarray + +print("\nSum:") +print(numpy.sum(np)) + +print("\nLog10:") +print(numpy.log10(np)) diff --git a/python/python-oracledb/dataframe_pandas.py b/python/python-oracledb/dataframe_pandas.py new file mode 100644 index 00000000..f233703f --- /dev/null +++ b/python/python-oracledb/dataframe_pandas.py @@ -0,0 +1,102 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_pandas.py +# +# Shows how to use connection.fetch_df_all() and connection.fetch_df_batches() +# to create Pandas dataframes. +# ----------------------------------------------------------------------------- + +import pandas +import pyarrow + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +SQL = "select id, name from SampleQueryTab order by id" + +# ----------------------------------------------------------------------------- +# +# Fetching all records + +# Get an OracleDataFrame. +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL, arraysize=100) + +# Get a Pandas DataFrame from the data +df = pyarrow.Table.from_arrays( + odf.column_arrays(), names=odf.column_names() +).to_pandas() + +# Perform various Pandas operations on the DataFrame + +print("Columns:") +print(df.columns) + +print("\nDataframe description:") +print(df.describe()) + +print("\nLast three rows:") +print(df.tail(3)) + +print("\nTransform:") +print(df.T) + +# ----------------------------------------------------------------------------- +# +# Batch record fetching +# +# Note that since this particular example ends up with all query rows being +# held in memory, it would be more efficient to use fetch_df_all() as shown +# above. + +print("\nFetching in batches:") +df = pandas.DataFrame() + +# Tune 'size' for your data set. Here it is small to show the batch fetch +# behavior on the sample table. +for odf in connection.fetch_df_batches(statement=SQL, size=10): + df_b = pyarrow.Table.from_arrays( + odf.column_arrays(), names=odf.column_names() + ).to_pandas() + print(f"Appending {df_b.shape[0]} rows") + df = pandas.concat([df, df_b], ignore_index=True) + +r, c = df.shape +print(f"{r} rows, {c} columns") + +print("\nLast three rows:") +print(df.tail(3)) diff --git a/python/python-oracledb/dataframe_pandas_async.py b/python/python-oracledb/dataframe_pandas_async.py new file mode 100644 index 00000000..796da794 --- /dev/null +++ b/python/python-oracledb/dataframe_pandas_async.py @@ -0,0 +1,109 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_pandas_async.py +# +# An asynchronous version of dataframe_pandas.py +# +# Shows how to use AsyncConnection.fetch_df_all() and +# AsyncConnection.fetch_df_batches(). This example then creates Pandas +# dataframes. Alternative dataframe libraries could be used similar to the +# other, synchronous, data frame samples. +# ----------------------------------------------------------------------------- + +import asyncio + +import pandas +import pyarrow + +import oracledb +import sample_env + + +async def main(): + connection = await oracledb.connect_async( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), + ) + + SQL = "select id, name from SampleQueryTab order by id" + + # ------------------------------------------------------------------------- + # + # Fetching all records + + # Get an OracleDataFrame. + # Adjust arraysize to tune the query fetch performance + odf = await connection.fetch_df_all(statement=SQL, arraysize=100) + + # Get a Pandas DataFrame from the data + df = pyarrow.Table.from_arrays( + odf.column_arrays(), names=odf.column_names() + ).to_pandas() + + # Perform various Pandas operations on the DataFrame + + print("Columns:") + print(df.columns) + + print("\nDataframe description:") + print(df.describe()) + + print("\nLast three rows:") + print(df.tail(3)) + + print("\nTransform:") + print(df.T) + + # ------------------------------------------------------------------------- + # + # Batch record fetching + # + # Note that since this particular example ends up with all query rows being + # held in memory, it would be more efficient to use fetch_df_all() as shown + # above. + + print("\nFetching in batches:") + df = pandas.DataFrame() + + # Tune 'size' for your data set. Here it is small to show the batch fetch + # behavior on the sample table. + async for odf in connection.fetch_df_batches(statement=SQL, size=10): + df_b = pyarrow.Table.from_arrays( + odf.column_arrays(), names=odf.column_names() + ).to_pandas() + print(f"Appending {df_b.shape[0]} rows") + df = pandas.concat([df, df_b], ignore_index=True) + + r, c = df.shape + print(f"{r} rows, {c} columns") + + print("\nLast three rows:") + print(df.tail(3)) + + +asyncio.run(main()) diff --git a/python/python-oracledb/dataframe_parquet_write.py b/python/python-oracledb/dataframe_parquet_write.py new file mode 100644 index 00000000..02a7d93f --- /dev/null +++ b/python/python-oracledb/dataframe_parquet_write.py @@ -0,0 +1,87 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_parquet_write.py +# +# Shows how to use connection.fetch_df_batches() to write files in Parquet +# format. +# ----------------------------------------------------------------------------- + +import os + +import pyarrow +import pyarrow.parquet as pq + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +PARQUET_FILE_NAME = "sample.parquet" + +if os.path.isfile(PARQUET_FILE_NAME): + os.remove(PARQUET_FILE_NAME) + +# Tune this for your query +FETCH_BATCH_SIZE = 10 + +SQL = "select id, name from SampleQueryTab order by id" +pqwriter = None + +for odf in connection.fetch_df_batches(statement=SQL, size=FETCH_BATCH_SIZE): + + pyarrow_table = pyarrow.Table.from_arrays( + arrays=odf.column_arrays(), names=odf.column_names() + ) + + if not pqwriter: + pqwriter = pq.ParquetWriter(PARQUET_FILE_NAME, pyarrow_table.schema) + + print(f"Writing a batch of {odf.num_rows()} rows") + pqwriter.write_table(pyarrow_table) + +pqwriter.close() + +# ----------------------------------------------------------------------------- +# Check the file was created + +print("\nParquet file metadata:") +print(pq.read_metadata(PARQUET_FILE_NAME)) + +# ----------------------------------------------------------------------------- +# Read the file + +print("\nParquet file data:") +t = pq.read_table(PARQUET_FILE_NAME, columns=["ID", "NAME"]) +print(t) diff --git a/python/python-oracledb/dataframe_polars.py b/python/python-oracledb/dataframe_polars.py new file mode 100644 index 00000000..7b91ced7 --- /dev/null +++ b/python/python-oracledb/dataframe_polars.py @@ -0,0 +1,96 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_polars.py +# +# Shows how to use connection.fetch_df_all() to efficiently put data into +# Polars DataFrames and Series. +# ----------------------------------------------------------------------------- + +import pyarrow +import polars + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +# ----------------------------------------------------------------------------- +# +# Polars DataFrame + +SQL1 = "select * from SampleQueryTab order by id" + +# Get an OracleDataFrame +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL1, arraysize=100) + +# Convert to a Polars DataFrame +pyarrow_table = pyarrow.Table.from_arrays( + odf.column_arrays(), names=odf.column_names() +) +p = polars.from_arrow(pyarrow_table) + +print(type(p)) # + +r, c = p.shape +print(f"{r} rows, {c} columns") + +print("\nSum:") +print(p.sum()) + +# ----------------------------------------------------------------------------- +# +# Polars Series + +SQL2 = "select id from SampleQueryTab order by id" + +# Get an OracleDataFrame +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL2, arraysize=100) + +# Convert to a Polars Series +pyarrow_array = pyarrow.array(odf.get_column_by_name("ID")) +p = polars.from_arrow(pyarrow_array) + +print(type(p)) # + +(r,) = p.shape +print(f"{r} rows") + +print("\nSum:") +print(p.sum()) + +print("\nLog10:") +print(p.log10()) diff --git a/python/python-oracledb/dataframe_pyarrow.py b/python/python-oracledb/dataframe_pyarrow.py new file mode 100644 index 00000000..d666f62b --- /dev/null +++ b/python/python-oracledb/dataframe_pyarrow.py @@ -0,0 +1,97 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_pyarrow.py +# +# Shows how to use connection.fetch_df_all() to create PyArrow tables and +# arrays. +# ----------------------------------------------------------------------------- + +import pyarrow + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +# ----------------------------------------------------------------------------- +# +# Creating a PyArrow table + +SQL1 = "select id, name from SampleQueryTab order by id" + +# Get an OracleDataFrame +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL1, arraysize=100) + +# Create a PyArrow table +pyarrow_table = pyarrow.Table.from_arrays( + arrays=odf.column_arrays(), names=odf.column_names() +) + +print("Type:") +print(type(pyarrow_table)) # + +# Perform various PyArrow operations + +print("\nColumn names:") +print(pyarrow_table.column_names) + +print("\nNumber of rows and columns:") +(r, c) = pyarrow_table.shape +print(f"{r} rows, {c} columns") + +# ----------------------------------------------------------------------------- +# +# Creating a PyArrow array + +SQL2 = "select id from SampleQueryTab order by id" + +# Get an OracleDataFrame +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL2, arraysize=100) + +# Create a PyArrow array +pyarrow_array = pyarrow.array(odf.get_column_by_name("ID")) + +print("Type:") +print(type(pyarrow_array)) # + +# Perform various PyArrow operations + +print("\nSum:") +print(pyarrow_array.sum()) + +print("\nFirst three elements:") +print(pyarrow_array.slice(0, 3)) diff --git a/python/python-oracledb/dataframe_torch.py b/python/python-oracledb/dataframe_torch.py new file mode 100644 index 00000000..e45d1940 --- /dev/null +++ b/python/python-oracledb/dataframe_torch.py @@ -0,0 +1,67 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2025, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# dataframe_torch.py +# +# Shows how to use connection.fetch_df_all() to efficiently put data into a +# Torch tensor via the DLPack standard memory layout. +# ----------------------------------------------------------------------------- + +import pyarrow +import torch + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +SQL = "select id from SampleQueryTab order by id" + +# Get an OracleDataFrame +# Adjust arraysize to tune the query fetch performance +odf = connection.fetch_df_all(statement=SQL, arraysize=100) + +# Convert to a Torch tensor via the Python DLPack specification +pyarrow_array = pyarrow.array(odf.get_column_by_name("ID")) +tt = torch.from_dlpack(pyarrow_array) + +print(type(tt)) # + +# Perform various Torch operations on the tensor + +print("\nSum:") +print(torch.sum(tt)) + +print("\nLog10:") +print(torch.log10(tt)) diff --git a/python/python-oracledb/multi_consumer_aq.py b/python/python-oracledb/multi_consumer_aq.py index c0744d0d..4fe62fa6 100644 --- a/python/python-oracledb/multi_consumer_aq.py +++ b/python/python-oracledb/multi_consumer_aq.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2020, 2023, Oracle and/or its affiliates. +# Copyright (c) 2020, 2025, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -37,8 +37,9 @@ import oracledb import sample_env -# this script is currently only supported in python-oracledb thick mode -oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) QUEUE_NAME = "DEMO_RAW_QUEUE_MULTI" PAYLOAD_DATA = [ @@ -61,35 +62,32 @@ queue.deqoptions.navigation = oracledb.DEQ_FIRST_MSG # enqueue a few messages -with connection.cursor() as cursor: - print("Enqueuing messages...") - for data in PAYLOAD_DATA: - print(data) - queue.enqone(connection.msgproperties(payload=data)) - connection.commit() - print() +print("Enqueuing messages...") +for data in PAYLOAD_DATA: + print(data) + queue.enqone(connection.msgproperties(payload=data)) +connection.commit() +print() # dequeue the messages for consumer A -with connection.cursor() as cursor: - print("Dequeuing the messages for consumer A...") - queue.deqoptions.consumername = "SUBSCRIBER_A" - while True: - props = queue.deqone() - if not props: - break - print(props.payload.decode()) - connection.commit() - print() +print("Dequeuing the messages for consumer A...") +queue.deqoptions.consumername = "SUBSCRIBER_A" +while True: + props = queue.deqone() + if not props: + break + print(props.payload.decode()) +connection.commit() +print() # dequeue the message for consumer B -with connection.cursor() as cursor: - print("Dequeuing the messages for consumer B...") - queue.deqoptions.consumername = "SUBSCRIBER_B" - while True: - props = queue.deqone() - if not props: - break - print(props.payload.decode()) - connection.commit() +print("Dequeuing the messages for consumer B...") +queue.deqoptions.consumername = "SUBSCRIBER_B" +while True: + props = queue.deqone() + if not props: + break + print(props.payload.decode()) +connection.commit() print("\nDone.") diff --git a/python/python-oracledb/object_aq.py b/python/python-oracledb/object_aq.py index eaf0803c..233ba012 100644 --- a/python/python-oracledb/object_aq.py +++ b/python/python-oracledb/object_aq.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2025, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -39,8 +39,9 @@ import oracledb import sample_env -# this script is currently only supported in python-oracledb thick mode -oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) BOOK_TYPE_NAME = "UDT_BOOK" QUEUE_NAME = "DEMO_BOOK_QUEUE" diff --git a/python/python-oracledb/pipelining_basic.py b/python/python-oracledb/pipelining_basic.py index 76bb1786..62be2609 100644 --- a/python/python-oracledb/pipelining_basic.py +++ b/python/python-oracledb/pipelining_basic.py @@ -66,24 +66,91 @@ async def main(): # pipeline.add_commit() # uncomment to persist data + pipeline.add_execute( + """create or replace procedure myprocerr as + begin + bogus; + end;""" + ) + + pipeline.add_execute( + """create or replace procedure myproc2 (p in number) as + begin + null; + end;""" + ) + + pipeline.add_execute( + """create or replace function myfunc (p in number) return number as + begin + return p; + end;""" + ) + + pipeline.add_callproc("myproc2", [123]) + + pipeline.add_callfunc("myfunc", oracledb.DB_TYPE_NUMBER, [456]) + + pipeline.add_fetchall("select 3 from does_not_exist") + pipeline.add_fetchall("select * from mytab") # Run the operations in the pipeline. # Note although the database receives all the operations at the same time, # it will execute each operation sequentially - results = await connection.run_pipeline(pipeline) + results = await connection.run_pipeline(pipeline, continue_on_error=True) # Print the query results for i, result in enumerate(results): - if result.rows: - statement = pipeline.operations[i].statement - print(f"\nRows from operation {i+1} '{statement}':\n") + statement = result.operation.statement + op_type = result.operation.op_type + + if result.warning: + print(f"\n-> OPERATION {i+1}: WARNING\n") + print(statement) + print(f"{result.warning}\n") + + elif result.error: + # This will only be invoked if the pipeline is run with + # continue_on_error=True + offset = result.error.offset + print(f"\n-> OPERATION {i+1}: ERROR AT POSITION {offset}:\n") + print(statement, "\n") + print(f"{result.error}\n") + + elif op_type == oracledb.PipelineOpType.EXECUTE: + print(f"\n-> OPERATION {i+1}: EXECUTE\n") + print(statement) + + elif op_type == oracledb.PipelineOpType.EXECUTE_MANY: + print(f"\n-> OPERATION {i+1}: EXECUTE_MANY\n") + print(statement) + + elif result.rows: + print(f"\n-> OPERATION {i+1}: ROWS\n") + print(statement, "\n") headings = [col.name for col in result.columns] print(*headings, sep="\t") print("--") for row in result.rows: print(*row, sep="\t") + elif op_type == oracledb.PipelineOpType.CALL_PROC: + print(f"\n-> OPERATION {i+1}: CALL_PROC\n") + print(result.operation.name) + + elif op_type == oracledb.PipelineOpType.CALL_FUNC: + print(f"\n-> OPERATION {i+1}: CALL_FUNC\n") + print(result.operation.name) + print(result.return_value) + + elif op_type == oracledb.PipelineOpType.COMMIT: + print(f"\n-> OPERATION {i+1}: COMMIT") + + else: + print(f"\n-> OPERATION {i+1}: Unknown\n") + print(f"Operation type: {op_type}") + # ------------------------------------------------------------ await connection.close() diff --git a/python/python-oracledb/pipelining_error.py b/python/python-oracledb/pipelining_error.py index 92190083..196ea8ae 100644 --- a/python/python-oracledb/pipelining_error.py +++ b/python/python-oracledb/pipelining_error.py @@ -76,7 +76,7 @@ async def main(): results = await connection.run_pipeline(pipeline, continue_on_error=True) for i, result in enumerate(results): - statement = pipeline.operations[i].statement + statement = result.operation.statement if result.warning: print( f"Warning {result.warning.full_code} " f"in operation {i+1}:\n" diff --git a/python/python-oracledb/plsql_batch.py b/python/python-oracledb/plsql_batch.py new file mode 100644 index 00000000..6cb0e8de --- /dev/null +++ b/python/python-oracledb/plsql_batch.py @@ -0,0 +1,193 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2024, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# plsql_batch.py +# +# Demonstrates using executemany() to make repeated calls to a PL/SQL procedure +# +# Note in python-oracledb Thick mode, when cursor.executemany() is used for +# PL/SQL code that returns OUT binds, it will have the same performance +# characteristics as repeated calls to cursor.execute(). +# ----------------------------------------------------------------------------- + +import oracledb +import sample_env + +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) + +connection = oracledb.connect( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), +) + +# ----------------------------------------------------------------------------- +# IN and OUT PL/SQL parameter examples +# Also shows passing in an object +# ----------------------------------------------------------------------------- + +# Setup + +with connection.cursor() as cursor: + stmts = [ + """create or replace type my_varchar_list as table of varchar2(100)""", + """create or replace procedure myproc + (p in number, names in my_varchar_list, count out number) as + begin + count := p + names.count; + end;""", + ] + for s in stmts: + cursor.execute(s) + if cursor.warning: + print(cursor.warning) + print(s) + +type_obj = connection.gettype("MY_VARCHAR_LIST") + +# Example 1: positional binds + +with connection.cursor() as cursor: + + obj1 = type_obj.newobject() + obj1.extend(["Alex", "Bobbie"]) + obj2 = type_obj.newobject() + obj2.extend(["Charlie", "Dave", "Eric"]) + obj3 = type_obj.newobject() + obj3.extend(["Fred", "Georgia", "Helen", "Ian"]) + + data = [ + (1, obj1), + (2, obj2), + (3, obj3), + ] + + count = cursor.var(oracledb.DB_TYPE_NUMBER, arraysize=len(data)) + cursor.setinputsizes(None, type_obj, count) + + cursor.executemany("begin myproc(:1, :2, :3); end;", data) + print(count.values) # [3, 5, 7] + +# Example 2: named binds + +with connection.cursor() as cursor: + + obj1 = type_obj.newobject() + obj1.extend(["Alex", "Bobbie"]) + obj2 = type_obj.newobject() + obj2.extend(["Charlie", "Dave", "Eric"]) + obj3 = type_obj.newobject() + obj3.extend(["Fred", "Georgia", "Helen", "Ian"]) + + data = [ + {"p": 100, "names": obj1}, + {"p": 200, "names": obj2}, + {"p": 300, "names": obj3}, + ] + + count = cursor.var(oracledb.DB_TYPE_NUMBER, arraysize=len(data)) + cursor.setinputsizes(p=None, names=type_obj, count=count) + + cursor.executemany("begin myproc(:p, :names, :count); end;", data) + print(count.values) # [102, 203, 304] + +# ----------------------------------------------------------------------------- +# IN/OUT PL/SQL parameter examples +# ----------------------------------------------------------------------------- + +# Setup + +with connection.cursor() as cursor: + stmt = """create or replace procedure myproc2 + (p1 in number, p2 in out varchar2) as + begin + p2 := p2 || ' ' || p1; + end;""" + cursor.execute(stmt) + if cursor.warning: + print(cursor.warning) + print(stmt) + +# Example 3: positional binds + +with connection.cursor() as cursor: + data = [(440, "Gregory"), (550, "Haley"), (660, "Ian")] + outvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + cursor.setinputsizes(None, outvals) + + cursor.executemany("begin myproc2(:1, :2); end;", data) + print(outvals.values) # ['Gregory 440', 'Haley 550', 'Ian 660'] + +# Example 4: positional binds, utilizing setvalue() + +with connection.cursor() as cursor: + data = [(777,), (888,), (999,)] + + inoutvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + inoutvals.setvalue(0, "Roger") + inoutvals.setvalue(1, "Sally") + inoutvals.setvalue(2, "Tom") + cursor.setinputsizes(None, inoutvals) + + cursor.executemany("begin myproc2(:1, :2); end;", data) + print(inoutvals.values) # ['Roger 777', 'Sally 888', 'Tom 999'] + +# Example 5: named binds + +with connection.cursor() as cursor: + data = [ + {"p1bv": 100, "p2bv": "Alfie"}, + {"p1bv": 200, "p2bv": "Brian"}, + {"p1bv": 300, "p2bv": "Cooper"}, + ] + outvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + cursor.setinputsizes(p1bv=None, p2bv=outvals) + + cursor.executemany("begin myproc2(:p1bv, :p2bv); end;", data) + print(outvals.values) # ['Alfie 100', 'Brian 200', 'Cooper 300'] + +# Example 6: named binds, utilizing setvalue() + +with connection.cursor() as cursor: + inoutvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + inoutvals.setvalue(0, "Dean") + inoutvals.setvalue(1, "Elsa") + inoutvals.setvalue(2, "Felix") + data = [{"p1bv": 101}, {"p1bv": 202}, {"p1bv": 303}] + cursor.setinputsizes(p1bv=None, p2bv=inoutvals) + + cursor.executemany("begin myproc2(:p1bv, :p2bv); end;", data) + print(inoutvals.values) # ['Dean 101', 'Elsa 202', 'Felix 303'] diff --git a/python/python-oracledb/plsql_batch_async.py b/python/python-oracledb/plsql_batch_async.py new file mode 100644 index 00000000..196d95cc --- /dev/null +++ b/python/python-oracledb/plsql_batch_async.py @@ -0,0 +1,201 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) 2024, Oracle and/or its affiliates. +# +# This software is dual-licensed to you under the Universal Permissive License +# (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License +# 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose +# either license. +# +# If you elect to accept the software under the Apache License, Version 2.0, +# the following applies: +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# plsql_batch_async.py +# +# An asynchronous version of plsql_batch.py +# +# Demonstrates using executemany() to make repeated calls to a PL/SQL procedure +# ----------------------------------------------------------------------------- + +import asyncio + +import oracledb +import sample_env + + +async def main(): + + connection = await oracledb.connect_async( + user=sample_env.get_main_user(), + password=sample_env.get_main_password(), + dsn=sample_env.get_connect_string(), + params=sample_env.get_connect_params(), + ) + + # ------------------------------------------------------------------------- + # IN and OUT PL/SQL parameter examples + # Also shows passing in an object + # ------------------------------------------------------------------------- + + # Setup + + pipeline = oracledb.create_pipeline() + + pipeline.add_execute( + """create or replace type my_varchar_list + as table of varchar2(100)""" + ) + + pipeline.add_execute( + """create or replace procedure myproc + (p in number, names in my_varchar_list, count out number) as + begin + count := p + names.count; + end;""" + ) + + await connection.run_pipeline(pipeline) + + # Example 1: positional binds + + type_obj = await connection.gettype("MY_VARCHAR_LIST") + + with connection.cursor() as cursor: + + obj1 = type_obj.newobject() + obj1.extend(["Alex", "Bobbie"]) + obj2 = type_obj.newobject() + obj2.extend(["Charlie", "Dave", "Eric"]) + obj3 = type_obj.newobject() + obj3.extend(["Fred", "Georgia", "Helen", "Ian"]) + + data = [ + (1, obj1), + (2, obj2), + (3, obj3), + ] + + count = cursor.var(oracledb.DB_TYPE_NUMBER, arraysize=len(data)) + cursor.setinputsizes(None, type_obj, count) + + await cursor.executemany("begin myproc(:1, :2, :3); end;", data) + print(count.values) # [3, 5, 7] + + # Example 2: named binds + + with connection.cursor() as cursor: + + obj1 = type_obj.newobject() + obj1.extend(["Alex", "Bobbie"]) + obj2 = type_obj.newobject() + obj2.extend(["Charlie", "Dave", "Eric"]) + obj3 = type_obj.newobject() + obj3.extend(["Fred", "Georgia", "Helen", "Ian"]) + + data = [ + {"p": 100, "names": obj1}, + {"p": 200, "names": obj2}, + {"p": 300, "names": obj3}, + ] + + count = cursor.var(oracledb.DB_TYPE_NUMBER, arraysize=len(data)) + cursor.setinputsizes(p=None, names=type_obj, count=count) + + await cursor.executemany( + "begin myproc(:p, :names, :count); end;", data + ) + + print(count.values) # [102, 203, 304] + + # ------------------------------------------------------------------------- + # IN/OUT PL/SQL parameter examples + # ------------------------------------------------------------------------- + + # Setup + + pipeline = oracledb.create_pipeline() + + pipeline.add_execute( + """create or replace procedure myproc2 + (p1 in number, p2 in out varchar2) as + begin + p2 := p2 || ' ' || p1; + end;""" + ) + + await connection.run_pipeline(pipeline) + + # Example 3: positional binds + + with connection.cursor() as cursor: + data = [(440, "Gregory"), (550, "Haley"), (660, "Ian")] + outvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + cursor.setinputsizes(None, outvals) + + await cursor.executemany("begin myproc2(:1, :2); end;", data) + print(outvals.values) # ['Gregory 440', 'Haley 550', 'Ian 660'] + + # Example 4: positional binds, utilizing setvalue() + + with connection.cursor() as cursor: + data = [(777,), (888,), (999,)] + + inoutvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + inoutvals.setvalue(0, "Roger") + inoutvals.setvalue(1, "Sally") + inoutvals.setvalue(2, "Tom") + cursor.setinputsizes(None, inoutvals) + + await cursor.executemany("begin myproc2(:1, :2); end;", data) + print(inoutvals.values) # ['Roger 777', 'Sally 888', 'Tom 999'] + + # Example 5: named binds + + with connection.cursor() as cursor: + data = [ + {"p1bv": 100, "p2bv": "Alfie"}, + {"p1bv": 200, "p2bv": "Brian"}, + {"p1bv": 300, "p2bv": "Cooper"}, + ] + outvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + cursor.setinputsizes(p1bv=None, p2bv=outvals) + + await cursor.executemany("begin myproc2(:p1bv, :p2bv); end;", data) + print(outvals.values) # ['Alfie 100', 'Brian 200', 'Cooper 300'] + + # Example 6: named binds, utilizing setvalue() + + with connection.cursor() as cursor: + inoutvals = cursor.var( + oracledb.DB_TYPE_VARCHAR, size=100, arraysize=len(data) + ) + inoutvals.setvalue(0, "Dean") + inoutvals.setvalue(1, "Elsa") + inoutvals.setvalue(2, "Felix") + data = [{"p1bv": 101}, {"p1bv": 202}, {"p1bv": 303}] + cursor.setinputsizes(p1bv=None, p2bv=inoutvals) + + await cursor.executemany("begin myproc2(:p1bv, :p2bv); end;", data) + print(inoutvals.values) # ['Dean 101', 'Elsa 202', 'Felix 303'] + + +asyncio.run(main()) diff --git a/python/python-oracledb/raw_aq.py b/python/python-oracledb/raw_aq.py index 526a00e7..67c96557 100644 --- a/python/python-oracledb/raw_aq.py +++ b/python/python-oracledb/raw_aq.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2019, 2023, Oracle and/or its affiliates. +# Copyright (c) 2019, 2025, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -37,8 +37,9 @@ import oracledb import sample_env -# this script is currently only supported in python-oracledb thick mode -oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) QUEUE_NAME = "DEMO_RAW_QUEUE" PAYLOAD_DATA = [ @@ -55,31 +56,28 @@ ) # create a queue -with connection.cursor() as cursor: - queue = connection.queue(QUEUE_NAME) - queue.deqoptions.wait = oracledb.DEQ_NO_WAIT - queue.deqoptions.navigation = oracledb.DEQ_FIRST_MSG +queue = connection.queue(QUEUE_NAME) +queue.deqoptions.wait = oracledb.DEQ_NO_WAIT +queue.deqoptions.navigation = oracledb.DEQ_FIRST_MSG - # dequeue all existing messages to ensure the queue is empty, just so that - # the results are consistent - while queue.deqone(): - pass +# dequeue all existing messages to ensure the queue is empty, just so that +# the results are consistent +while queue.deqone(): + pass # enqueue a few messages print("Enqueuing messages...") -with connection.cursor() as cursor: - for data in PAYLOAD_DATA: - print(data) - queue.enqone(connection.msgproperties(payload=data)) - connection.commit() +for data in PAYLOAD_DATA: + print(data) + queue.enqone(connection.msgproperties(payload=data)) +connection.commit() # dequeue the messages print("\nDequeuing messages...") -with connection.cursor() as cursor: - while True: - props = queue.deqone() - if not props: - break - print(props.payload.decode()) - connection.commit() - print("\nDone.") +while True: + props = queue.deqone() + if not props: + break + print(props.payload.decode()) +connection.commit() +print("\nDone.") diff --git a/python/python-oracledb/sql/create_schema.sql b/python/python-oracledb/sql/create_schema.sql index 7a7c816f..d160e984 100644 --- a/python/python-oracledb/sql/create_schema.sql +++ b/python/python-oracledb/sql/create_schema.sql @@ -391,6 +391,44 @@ insert into &main_user..SampleQueryTab values (6, 'Frankie') / insert into &main_user..SampleQueryTab values (7, 'Gerri') / +insert into &main_user..SampleQueryTab values (8, 'Harriet') +/ +insert into &main_user..SampleQueryTab values (9, 'Isabelle') +/ +insert into &main_user..SampleQueryTab values (10, 'Jarek') +/ +insert into &main_user..SampleQueryTab values (11, 'Krishna') +/ +insert into &main_user..SampleQueryTab values (12, 'Leo') +/ +insert into &main_user..SampleQueryTab values (13, 'Mia') +/ +insert into &main_user..SampleQueryTab values (14, 'Nathalie') +/ +insert into &main_user..SampleQueryTab values (15, 'Oscar') +/ +insert into &main_user..SampleQueryTab values (16, 'Pia') +/ +insert into &main_user..SampleQueryTab values (17, 'Quentin') +/ +insert into &main_user..SampleQueryTab values (18, 'Roger') +/ +insert into &main_user..SampleQueryTab values (19, 'Sally') +/ +insert into &main_user..SampleQueryTab values (20, 'Tully') +/ +insert into &main_user..SampleQueryTab values (21, 'Una') +/ +insert into &main_user..SampleQueryTab values (22, 'Valerie') +/ +insert into &main_user..SampleQueryTab values (23, 'William') +/ +insert into &main_user..SampleQueryTab values (24, 'Xavier') +/ +insert into &main_user..SampleQueryTab values (25, 'Yasmin') +/ +insert into &main_user..SampleQueryTab values (26, 'Zach') +/ commit / diff --git a/python/python-oracledb/sql/create_schema_23.sql b/python/python-oracledb/sql/create_schema_23.sql index e96e7f86..30daef5f 100644 --- a/python/python-oracledb/sql/create_schema_23.sql +++ b/python/python-oracledb/sql/create_schema_23.sql @@ -27,15 +27,16 @@ * * Performs the actual work of creating and populating the schemas with the * database objects used by the python-oracledb samples that require Oracle - * Database 23.5 or higher. It is executed by the Python script + * Database 23.7 or higher. It is executed by the Python script * create_schema.py. *---------------------------------------------------------------------------*/ create table &main_user..SampleVectorTab ( - v32 vector(3, float32), - v64 vector(3, float64), - v8 vector(3, int8), - vbin vector(24, binary) + v32 vector(3, float32), + v64 vector(3, float64), + v8 vector(3, int8), + vbin vector(24, binary), + v64sparse vector(30, float64, sparse) ) / diff --git a/python/python-oracledb/transaction_guard.py b/python/python-oracledb/transaction_guard.py index a473ef8a..a9f8fdf5 100644 --- a/python/python-oracledb/transaction_guard.py +++ b/python/python-oracledb/transaction_guard.py @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2016, 2023, Oracle and/or its affiliates. +# Copyright (c) 2016, 2025, Oracle and/or its affiliates. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # @@ -57,8 +57,9 @@ import oracledb import sample_env -# this script is currently only supported in python-oracledb thick mode -oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) +# determine whether to use python-oracledb thin mode or thick mode +if not sample_env.get_is_thin(): + oracledb.init_oracle_client(lib_dir=sample_env.get_oracle_client()) # constants CONNECT_STRING = "localhost/orcl-tg" @@ -76,15 +77,28 @@ cursor = connection.cursor() cursor.execute("delete from TestTempTable where IntCol = 1") cursor.execute("insert into TestTempTable values (1, null)") -input( - "Please kill %s session now. Press ENTER when complete." - % sample_env.get_main_user() -) + +try: + sql = """select unique + 'alter system kill session '''||sid||','||serial#||''';' + from v$session_connect_info + where sid = sys_context('USERENV', 'SID')""" + (killsql,) = connection.cursor().execute(sql).fetchone() + print(f"Execute this SQL statement as a DBA user in SQL*Plus:\n {killsql}") +except Exception: + print( + "As a DBA user in SQL*Plus, use ALTER SYSTEM KILL SESSION " + f"to terminate the {sample_env.get_main_user()} session now." + ) + +input("Press ENTER when complete.") + try: connection.commit() # this should fail - sys.exit("Session was not killed. Terminating.") + sys.exit("Session was not killed. Sample cannot continue.") except oracledb.DatabaseError as e: (error_obj,) = e.args + print("Session is recoverable:", error_obj.isrecoverable) if not error_obj.isrecoverable: sys.exit("Session is not recoverable. Terminating.") ltxid = connection.ltxid diff --git a/python/python-oracledb/vector.py b/python/python-oracledb/vector.py index 49f90bbf..eb38af06 100644 --- a/python/python-oracledb/vector.py +++ b/python/python-oracledb/vector.py @@ -45,16 +45,21 @@ params=sample_env.get_connect_params(), ) -# this script only works with Oracle Database 23.5 or later -if sample_env.get_server_version() < (23, 5): - sys.exit("This example requires Oracle Database 23.5 or later.") +# this script only works with Oracle Database 23.7 or later +# +# The VECTOR datatype was initially introduced in Oracle Database 23.4. +# The BINARY vector format was introduced in Oracle Database 23.5. +# The SPARSE vector format was introduced in Oracle Database 23.7. + +if sample_env.get_server_version() < (23, 7): + sys.exit("This example requires Oracle Database 23.7 or later.") -# this script works with thin mode, or with thick mode using Oracle Client 23.5 +# this script works with thin mode, or with thick mode using Oracle Client 23.7 # or later -if not connection.thin and oracledb.clientversion()[:2] < (23, 5): +if not connection.thin and oracledb.clientversion()[:2] < (23, 7): sys.exit( "This example requires python-oracledb thin mode, or Oracle Client" - " 23.5 or later" + " 23.7 or later" ) with connection.cursor() as cursor: @@ -63,11 +68,20 @@ vector1_data_64 = array.array("d", [11.25, 11.75, 11.5]) vector1_data_8 = array.array("b", [1, 2, 3]) vector1_data_bin = array.array("B", [180, 150, 100]) + vector1_data_sparse64 = oracledb.SparseVector( + 30, [9, 16, 24], array.array("d", [19.125, 78.5, 977.375]) + ) cursor.execute( - """insert into SampleVectorTab (v32, v64, v8, vbin) - values (:1, :2, :3, :4)""", - [vector1_data_32, vector1_data_64, vector1_data_8, vector1_data_bin], + """insert into SampleVectorTab (v32, v64, v8, vbin, v64sparse) + values (:1, :2, :3, :4, :5)""", + [ + vector1_data_32, + vector1_data_64, + vector1_data_8, + vector1_data_bin, + vector1_data_sparse64, + ], ) # Multi-row insert @@ -75,26 +89,45 @@ vector2_data_64 = array.array("d", [22.25, 22.75, 22.5]) vector2_data_8 = array.array("b", [4, 5, 6]) vector2_data_bin = array.array("B", [40, 15, 255]) + vector2_data_sparse64 = oracledb.SparseVector( + 30, [3, 10, 12], array.array("d", [2.5, 2.5, 1.0]) + ) vector3_data_32 = array.array("f", [3.625, 3.5, 3.0]) vector3_data_64 = array.array("d", [33.25, 33.75, 33.5]) vector3_data_8 = array.array("b", [7, 8, 9]) vector3_data_bin = array.array("B", [0, 17, 101]) + vector3_data_sparse64 = oracledb.SparseVector( + 30, [8, 15, 29], array.array("d", [1.125, 200.5, 100.0]) + ) rows = [ - (vector2_data_32, vector2_data_64, vector2_data_8, vector2_data_bin), - (vector3_data_32, vector3_data_64, vector3_data_8, vector3_data_bin), + ( + vector2_data_32, + vector2_data_64, + vector2_data_8, + vector2_data_bin, + vector2_data_sparse64, + ), + ( + vector3_data_32, + vector3_data_64, + vector3_data_8, + vector3_data_bin, + vector3_data_sparse64, + ), ] cursor.executemany( - """insert into SampleVectorTab (v32, v64, v8, vbin) - values (:1, :2, :3, :4)""", + """insert into SampleVectorTab (v32, v64, v8, vbin, v64sparse) + values (:1, :2, :3, :4, :5)""", rows, ) # Query cursor.execute("select * from SampleVectorTab") - # Each vector is represented as an array.array type + # Each non-sparse vector is represented as an array.array type. + # Sparse vectors are represented as oracledb.SparseVector() instances for row in cursor: print(row) diff --git a/python/python-oracledb/vector_async.py b/python/python-oracledb/vector_async.py index 1f349e70..47b11f65 100644 --- a/python/python-oracledb/vector_async.py +++ b/python/python-oracledb/vector_async.py @@ -46,9 +46,14 @@ async def main(): params=sample_env.get_connect_params(), ) - # this script only works with Oracle Database 23.5 or later - if sample_env.get_server_version() < (23, 5): - sys.exit("This example requires Oracle Database 23.5 or later.") + # this script only works with Oracle Database 23.7 or later + # + # The VECTOR datatype was initially introduced in Oracle Database 23.4. + # The BINARY vector format was introduced in Oracle Database 23.5. + # The SPARSE vector format was introduced in Oracle Database 23.7. + + if sample_env.get_server_version() < (23, 7): + sys.exit("This example requires Oracle Database 23.7 or later.") with connection.cursor() as cursor: # Single-row insert @@ -56,15 +61,19 @@ async def main(): vector1_data_64 = array.array("d", [11.25, 11.75, 11.5]) vector1_data_8 = array.array("b", [1, 2, 3]) vector1_data_bin = array.array("B", [180, 150, 100]) + vector1_data_sparse64 = oracledb.SparseVector( + 30, [9, 16, 24], array.array("d", [19.125, 78.5, 977.375]) + ) await cursor.execute( - """insert into SampleVectorTab (v32, v64, v8, vbin) - values (:1, :2, :3, :4)""", + """insert into SampleVectorTab (v32, v64, v8, vbin, v64sparse) + values (:1, :2, :3, :4, :5)""", [ vector1_data_32, vector1_data_64, vector1_data_8, vector1_data_bin, + vector1_data_sparse64, ], ) @@ -73,11 +82,17 @@ async def main(): vector2_data_64 = array.array("d", [22.25, 22.75, 22.5]) vector2_data_8 = array.array("b", [4, 5, 6]) vector2_data_bin = array.array("B", [40, 15, 255]) + vector2_data_sparse64 = oracledb.SparseVector( + 30, [3, 10, 12], array.array("d", [2.5, 2.5, 1.0]) + ) vector3_data_32 = array.array("f", [3.625, 3.5, 3.0]) vector3_data_64 = array.array("d", [33.25, 33.75, 33.5]) vector3_data_8 = array.array("b", [7, 8, 9]) vector3_data_bin = array.array("B", [0, 17, 101]) + vector3_data_sparse64 = oracledb.SparseVector( + 30, [8, 15, 29], array.array("d", [1.125, 200.5, 100.0]) + ) rows = [ ( @@ -85,25 +100,28 @@ async def main(): vector2_data_64, vector2_data_8, vector2_data_bin, + vector2_data_sparse64, ), ( vector3_data_32, vector3_data_64, vector3_data_8, vector3_data_bin, + vector3_data_sparse64, ), ] await cursor.executemany( - """insert into SampleVectorTab (v32, v64, v8, vbin) - values (:1, :2, :3, :4)""", + """insert into SampleVectorTab (v32, v64, v8, vbin, v64sparse) + values (:1, :2, :3, :4, :5)""", rows, ) # Query await cursor.execute("select * from SampleVectorTab") - # Each vector is represented as an array.array type + # Each non-sparse vector is represented as an array.array type. + # Sparse vectors are represented as oracledb.SparseVector() instances async for row in cursor: print(row) From 538954fd984ad29fffbd8e5163937dee961acb99 Mon Sep 17 00:00:00 2001 From: Gerald Venzl Date: Mon, 2 Jun 2025 17:35:57 -0700 Subject: [PATCH 36/37] Update submodules (#445) * Remove legacy dw-vldb-samples now in 'optimizer' repo Signed-off-by: Gerald Venzl * Reorganize sub modules Signed-off-by: Gerald Venzl * Update README.md * Update README.md * Update README.md --------- Signed-off-by: Gerald Venzl --- .gitmodules | 9 --------- README.md | 21 ++++++++++++--------- db-sample-schemas | 2 +- dotnet | 1 - sql/dw-vldb-samples | 1 - 5 files changed, 13 insertions(+), 21 deletions(-) delete mode 160000 dotnet delete mode 160000 sql/dw-vldb-samples diff --git a/.gitmodules b/.gitmodules index d0b66b90..046dc481 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,3 @@ -[submodule "sql/dw-vldb-samples"] - path = sql/dw-vldb-samples - url = https://github.com/oracle/dw-vldb-samples - branch = master [submodule "db-sample-schemas"] path = db-sample-schemas url = https://github.com/oracle/db-sample-schemas - branch = main -[submodule "dotnet"] - path = dotnet - url = https://github.com/oracle/dotnet-db-samples - branch = master diff --git a/README.md b/README.md index a7aaa3bb..2e24d8a3 100644 --- a/README.md +++ b/README.md @@ -4,42 +4,45 @@ This repository stores a variety of examples demonstrating how to use the Oracle | Repo/Folder name | Description | | ------------- | ------------- | | [C](./C) | C examples | +| [Multicloud](./Multicloud) | Multicloud examples | | [apex](./apex) | APEX examples | | [db-sample-schemas](https://github.com/oracle/db-sample-schemas) | Git submodule of the Oracle Database Sample Schemas | -| [dotnet](https://github.com/oracle/dotnet-db-samples) | .NET based examples | | [exadata](./exadata) | Exadata examples | | [java](./java) | Java examples | | [javascript](./javascript) | JavaScript examples | +| [json-relational-duality](./json-relational-duality) | JSON Relational Duality examples | [machine-learning](./machine-learning) | Oracle Machine Learning examples | -| [optimizer](./optimizer) | Oracle Optmizer and Optimizer Stats examples | +| [optimizer](./optimizer) | Oracle Optimizer and Optimizer Stats examples | | [plsql](./plsql) | PL/SQL examples | | [python](./python) | Python examples | | [ruby](./ruby) | Ruby examples | -| [sagas](./sagas) | Saga examples | +| [sagas](./sagas) | Sagas examples | | [security](./security) | Security features examples | | [spatial](./spatial) | Spatial features examples | +| [sql-firewall](./sql-firewall) | SQL Firewall examples | | [sql](./sql) | SQL examples | | [sqldeveloper](./sqldeveloper) | [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) examples | +| [text](./text) | Oracle Text examples | | [txeventq](./txeventq) | TxEventQ examples | ## Documentation -You can find the online documentation of the Oracle Database under [docs.oracle.com/en/database/](http://docs.oracle.com/en/database/) +You can find the online documentation of the Oracle Database under: [docs.oracle.com/en/database/](http://docs.oracle.com/en/database/) ## LiveSQL -Some of the examples that you see within this repository can be executed in the free web-based tool: [LiveSQL.oracle.com](https://livesql.oracle.com). +Some of the examples that you see within this repository can be executed in the free web-based tool: [LiveSQL.oracle.com](https://livesql.oracle.com) LiveSQL is also an excellent resource for getting started with Oracle Database. ## Dev Gym -If you would like to challenge yourself, you can take quizzes, workouts and classes at [DevGym.oracle.com](https://devgym.oracle.com). +If you would like to challenge yourself, you can take quizzes, workouts and classes at: [DevGym.oracle.com](https://devgym.oracle.com) ## Contributing -This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md) +This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md). ## Security -Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process +Please consult the [security guide](./SECURITY.md) for our responsible security vulnerability disclosure process. ## License @@ -48,7 +51,7 @@ Apache License, Version 2.0 (the "License.") You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is -also reproduced in [LICENSE.md](./LICENSE.md) +also reproduced in [LICENSE.txt](./LICENSE.txt). Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/db-sample-schemas b/db-sample-schemas index 99049719..f5204d17 160000 --- a/db-sample-schemas +++ b/db-sample-schemas @@ -1 +1 @@ -Subproject commit 99049719d53c2e0810b7a8462965636b98161131 +Subproject commit f5204d177d7641a468846764b67a4ee41d42ff26 diff --git a/dotnet b/dotnet deleted file mode 160000 index fbab2e6e..00000000 --- a/dotnet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fbab2e6efd04785fbd41a1f79b24c29c2cbfd5fc diff --git a/sql/dw-vldb-samples b/sql/dw-vldb-samples deleted file mode 160000 index 36b46958..00000000 --- a/sql/dw-vldb-samples +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 36b46958aa0a04dc96c8e38870278999b62c6fc6 From 79bde2d5def0b0ed8cf5509a67a47d4aa542445a Mon Sep 17 00:00:00 2001 From: Sharad Chandran R Date: Tue, 24 Jun 2025 03:48:48 +0530 Subject: [PATCH 37/37] Add more C examples and update the makefile and README files (#447) * Create simpleConnDemo.c Basic Connection and Query execution to Oracle Database * Update and rename drcp.c to drcpDemo.c Update the username and password to a generic string * Update makefile Make the makefile generic * Update simpleConnDemo.c Add the required setup and related blog details * Update simpleConnDemo.c Remove blog details. To be updated in README * Create sessionPoolingDemo Demo for OCI Session Pooling and Multithreading * Update README.md Add more details in the README.md file * Update README.md Minor change * Rename sessionPoolingDemo to sessionPoolingDemo.c Add .c extension in the file name * Update makefile Make the makefile more correct * Update makefile Add some comments --- C/README.md | 9 + C/{drcp.c => drcpDemo.c} | 8 +- C/makefile | 25 ++- C/sessionPoolingDemo.c | 475 +++++++++++++++++++++++++++++++++++++++ C/simpleConnDemo.c | 459 +++++++++++++++++++++++++++++++++++++ 5 files changed, 964 insertions(+), 12 deletions(-) rename C/{drcp.c => drcpDemo.c} (98%) create mode 100644 C/sessionPoolingDemo.c create mode 100644 C/simpleConnDemo.c diff --git a/C/README.md b/C/README.md index 02910c16..ed37cdc1 100644 --- a/C/README.md +++ b/C/README.md @@ -1,2 +1,11 @@ # Oracle Call Interface (OCI) Examples This directory contains samples that uses Oracle Call Interface's C libraries for accessing and working with Oracle Database. +It also contains a sample makefile that can be used to compile these samples and create executables. + +List of files +------------- +| File Name | Description | +|-----------|-------------| +|[simpleConnDemo.c](./simpleConnDemo.c)| Shows a simple connection and query to Oracle Database using OCI. For explanation and the required setup, see the [blog](https://medium.com/oracledevs/oracle-call-interface-for-c-developers-simple-database-connection-and-query-58be8243a393).| +|[sessionPoolingDemo.c](./sessionPoolingDemo.c)| Shows session pooling with Oracle Database using OCI Threads. For explanation and the required setup, see the [blog](https://medium.com/oracledevs/oracle-call-interface-for-c-developers-session-pooling-and-multithreading-87f56cec993a).| +|[drcpDemo.c](./drcpDemo.c)| Shows a simple query with DRCP connection to Oracle Database using OCI| diff --git a/C/drcp.c b/C/drcpDemo.c similarity index 98% rename from C/drcp.c rename to C/drcpDemo.c index eba03dbf..b8181f6d 100644 --- a/C/drcp.c +++ b/C/drcpDemo.c @@ -1,6 +1,6 @@ -/* Copyright (c) 2022, Oracle. All rights reserved. */ +/* Copyright (c) 2022, 2025, Oracle. All rights reserved. */ -/* drcp.c */ +/* drcpDemo.c */ /* Oracle OCI Database Resident Connection Pooling (DRCP) Example */ /* Christopher Jones, 2022 */ @@ -11,8 +11,8 @@ #include #include -// const OraText userName[] = "SCOTT"; -// const OraText userPassword[] = "TIGER"; +// const OraText userName[] = ""; +// const OraText userPassword[] = ""; /* Take the user credentials as inputs*/ OraText userName[129]; diff --git a/C/makefile b/C/makefile index 8142040c..af4289b3 100644 --- a/C/makefile +++ b/C/makefile @@ -1,18 +1,27 @@ -# Copyright (c) 2022, Oracle. All rights reserved. -# Makefile for Oracle OCI Database Resident Connection Pooling (DRCP) Example +# Copyright (c) 2022, 2025, Oracle. All rights reserved. +# Makefile for Oracle Call Interface examples # Christopher Jones, 2022 +# Sharad Chandran R, 2025 -IC=$(HOME)/instantclient_19_11 +# Update the instant client path here +IC=$(HOME)/instantclient_19_26 OLIB=$(IC) OINC=$(IC)/sdk/include +DEMOS=drcpDemo simpleConnDemo sessionPoolingDemo -#OH=/u01/app/oracle/product/12.1.0/dbhome_1 +# Uncomment the following 3 lines if you are using an +# Oracle Database home +#OH=/u01/app/oracle/product/19.26.0/dbhome_1 #OLIB=$(OH)/lib #OINC=$(OH)/rdbms/public -drcp: clean - $(CC) -Wall -Wextra -c -I$(OINC) drcp.c - $(CC) -o drcp drcp.o -Wl,--rpath -Wl,$(OLIB) -L$(OLIB) -lclntsh +.PHONY: all clean + +all: $(DEMOS) + +$(DEMOS): %: %.c + $(CC) -Wall -Wextra -c -I$(OINC) $< + $(CC) -o $@ $@.o -Wl,--rpath -Wl,$(OLIB) -L$(OLIB) -lclntsh clean: - rm -f drcp.o drcp + rm -f $(DEMOS) *.o diff --git a/C/sessionPoolingDemo.c b/C/sessionPoolingDemo.c new file mode 100644 index 00000000..813dc307 --- /dev/null +++ b/C/sessionPoolingDemo.c @@ -0,0 +1,475 @@ +/* Copyright (c) 2025, Oracle and/or its affiliates.*/ +/* + NAME + sessionPoolingDemo.c - Basic OCI Session Pooling with multithreading + DESCRIPTION + This program invokes multiple threads to insert MAXTHREADS records + into the EMPLOYEES table using session pools (Employee ids 100-109). + This program assumes that sample HR schema is setup and the EMPLOYEES + table is created with employee_id as the primary key. +*/ + +#ifndef OCI_ORACLE +# include +#endif + +#include +#include +#include + +#define MAXTHREADS 10 // Maximum number of threads + +// Maximum lengths for columns +#define MAX_NAME_LEN_FIRST 20 +#define MAX_NAME_LEN_LAST 25 +#define MAX_EMAIL_LEN 50 +#define MAX_JOB_LEN 20 + +static ub4 sessMin = 3; // Min no. of pooled sessions +static ub4 sessMax = 8; // Max no. of pooled sessions +static ub4 sessIncr = 5; // increment number + +static OCIError *errhp; +static OCIEnv *envhp; +static OCISPool *poolhp = (OCISPool *) 0; +static int employeeNum[MAXTHREADS]; + +static OraText *poolName; +static ub4 poolNameLen; + +// application user to set the database credentials here +static char *username = ""; +static char *password = ""; +static char *connstr = ""; + +/* Values to be inserted into the 'employees' table */ +static char* firstname[10] = { "A","B","C","D","E","F","G","H","I","J" }; +static char* lastname[10] = { "A","B","C","D","E","F","G","H","I","J"} ; +static char* email[10] = { "A@example.com","B@example.com","C@example.com", + "D@example.com","E@example.com","F@example.com", + "G@example.com","H@example.com","I@example.com", + "J@example.com"}; +static char* ejob[10] = { "FI_ACCOUNT","AC_ACCOUNT","SA_MAN","PU_MAN", + "PU_CLERK","IT_PROG","MK_REP","AD_VP","AC_MGR", + "HR_REP" }; +static float esal[10] = { 10000.00, 5000.00, + 8000.00, 6000.00, + 10000.00, 8000.50, + 6000.00, 6000.70, + 5000.00, 5000.00 }; + +static char* hiredate[10] = { "07-JUN-96", "08-JAN-95", "18-JUL-98", + "21-FEB-99", "02-JUL-04", "13-AUG-08", + "28-DEC-10", "27-SEP-15", "01-JUL-16", + "01-AUG-19" }; + +static unsigned int edept_id[10] = { 10, 20, 10, 20, 30, 10, 30, 20, 10, 20 }; + +static void checkerr (OCIError *errhp, sword status); +static void threadFunction (dvoid *arg); +static void fetchAndPrintData(void); +static sword threadCleanup(OCISvcCtx *svchp, OCIAuthInfo *authInfop, + OCIError* errhp1, OCIStmt *stmthp); + +/* ----------------------------------------------------------------- */ +/* Main function definition */ +/* ----------------------------------------------------------------- */ +int main(void) +{ + int timeout = 1; // 1 second + sword status; + int i = 0; + + /** Stage 1: Establish connection to the database using session pool */ + + // set the environment handle to use OCI threaded mode + OCIEnvCreate(&envhp, OCI_THREADED, (dvoid *) 0, NULL, NULL, NULL, 0, + (dvoid *) 0); + + // Allocate the error and pool handles + (void) OCIHandleAlloc((dvoid *) envhp, (dvoid **) &errhp, OCI_HTYPE_ERROR, + (size_t) 0, (dvoid **) 0); + (void) OCIHandleAlloc((dvoid *) envhp, (dvoid **) &poolhp, OCI_HTYPE_SPOOL, + (size_t) 0, (dvoid **) 0); + + // set the session pool timeout + checkerr(errhp, OCIAttrSet((dvoid *) poolhp, + (ub4) OCI_HTYPE_SPOOL, (dvoid *) &timeout, (ub4) 0, + OCI_ATTR_SPOOL_TIMEOUT, errhp)); + + // session pool creation + if (status = OCISessionPoolCreate(envhp, errhp, poolhp, + (OraText **) &poolName, (ub4 *) &poolNameLen, + (const OraText *) connstr, + (ub4)strlen((const signed char *) connstr), + sessMin, sessMax, sessIncr, (OraText *) username, + (ub4)strlen((const signed char *) username), + (OraText *) password, + (ub4)strlen((const signed char *) password), + OCI_DEFAULT)) + checkerr(errhp,status); + + printf("Session Pool: \"%s\" Created \n", poolName); + + /** Stage 2: Insert employee data using OCI Session Pools and Threads */ + + OCIThreadId *thrid[MAXTHREADS]; + OCIThreadHandle *thrhp[MAXTHREADS]; + + OCIThreadProcessInit(); + checkerr (errhp, OCIThreadInit(envhp, errhp)); + for (i = 0; i < MAXTHREADS; ++i) + { + checkerr(errhp, OCIThreadIdInit(envhp, errhp, &thrid[i])); + checkerr(errhp, OCIThreadHndInit(envhp, errhp, &thrhp[i])); + } + for (i = 0; i < MAXTHREADS; ++i) + { + employeeNum[i] = i; + // Create the threads for inserting the records into the + // "employee" table + checkerr(errhp, OCIThreadCreate(envhp, errhp, threadFunction, + (dvoid *) &employeeNum[i], thrid[i], thrhp[i])); + } + for (i = 0; i < MAXTHREADS; ++i) + { + checkerr(errhp, OCIThreadJoin(envhp, errhp, thrhp[i])); + checkerr(errhp, OCIThreadClose(envhp, errhp, thrhp[i])); + checkerr(errhp, OCIThreadIdDestroy(envhp, errhp, &(thrid[i]))); + checkerr(errhp, OCIThreadHndDestroy(envhp, errhp, &(thrhp[i]))); + } + checkerr(errhp, OCIThreadTerm(envhp, errhp)); + + /** Stage 3: Fetch the inserted data and print it */ + + // fetch and print the entire employee data inserted + (void) fetchAndPrintData(); + + /** Stage 4: Close the session pool and clean up buffers and handles */ + + // Close the session pool + status = OCISessionPoolDestroy(poolhp, errhp, OCI_DEFAULT); + if (status != OCI_SUCCESS) + checkerr(errhp, status); + printf("Session Pool: \"%s\" Closed.\n", poolName); + + // free all handles and buffers + checkerr(errhp, OCIHandleFree((dvoid *) poolhp, OCI_HTYPE_SPOOL)); + checkerr(errhp, OCIHandleFree((dvoid *) errhp, OCI_HTYPE_ERROR)); + if (envhp) + OCIHandleFree((dvoid *) envhp, (ub4) OCI_HTYPE_ENV); + + OCITerminate(OCI_DEFAULT); + return 0; +} + +/* ----------------------------------------------------------------- */ +/* Inserts records into the 'employees' table */ +/* ----------------------------------------------------------------- */ +static void threadFunction(dvoid *arg) +{ + int idx = *(int *)arg; + int empno = idx + 100; + int firstnm_len = strlen((char *) firstname[idx]) + 1; + int lastnm_len = strlen((char *) lastname[idx]) + 1; + int em_len = strlen((char *) email[idx]) + 1; + int job_len = strlen((char *) ejob[idx]) + 1; + OraText firstnm[firstnm_len], + lastnm[lastnm_len], + em[em_len], + job[job_len]; + + // OCI handle and pointer declarations + OCISvcCtx *svchp = (OCISvcCtx *) 0; + OCIStmt *stmthp = (OCIStmt *) 0; + OCIError *errhp2 = (OCIError *) 0; // separate error handle for the thread + OCIAuthInfo *authp = (OCIAuthInfo *) 0; + OCIBind *bndp_arr[8] = { + (OCIBind *) 0, (OCIBind *) 0, (OCIBind *) 0, (OCIBind *) 0, + (OCIBind *) 0, (OCIBind *) 0, (OCIBind *) 0, (OCIBind *) 0 + }; + OCIDefine *defnp = (OCIDefine *) 0; + + // SQL statements to execute + OraText *insertstmt = (OraText *) "INSERT INTO EMPLOYEES(employee_id,\ + first_name, last_name, email, hire_date, job_id, salary,\ + department_id) values(:empid, :firstname, :lastname,\ + :email, :hiredt, :ejob, :esal, :edept_id)"; + + sword status; + + // allocate error handle and session authentication information handle + (void) OCIHandleAlloc((dvoid *) envhp, (dvoid **) &errhp2, OCI_HTYPE_ERROR, + (size_t) 0, (dvoid **) 0); + checkerr(errhp2, OCIHandleAlloc((dvoid *) envhp, + (dvoid **) &authp, (ub4) OCI_HTYPE_AUTHINFO, + (size_t) 0, (dvoid **) 0)); + + // set user credentials into the authentication informaton handle + checkerr(errhp2, OCIAttrSet((dvoid *) authp,(ub4) OCI_HTYPE_AUTHINFO, + (dvoid *) username, (ub4) strlen((char *) username), + (ub4) OCI_ATTR_USERNAME, errhp2)); + checkerr(errhp2,OCIAttrSet((dvoid *) authp,(ub4) OCI_HTYPE_AUTHINFO, + (dvoid *) password, (ub4) strlen((char *) password), + (ub4) OCI_ATTR_PASSWORD, errhp2)); + + // get a session from the pool + checkerr(errhp2, OCISessionGet(envhp, errhp2, &svchp, authp, + (OraText *) poolName, (ub4) strlen((char *) poolName), + NULL, 0, NULL, NULL, NULL, OCI_SESSGET_SPOOL)); + + // prepare the INSERT statement + checkerr(errhp2, OCIStmtPrepare2(svchp, (OCIStmt **) &stmthp, errhp2, + (const OraText *) insertstmt, + (ub4)strlen((const signed char *) insertstmt), + NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT)); + + // bind the placeholders in the INSERT statement + if ((status = OCIBindByName(stmthp, &bndp_arr[0], errhp2, + (OraText *) ":EMPID", -1, (dvoid *) &empno, + (sword) sizeof(empno), SQLT_INT, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[1], errhp2, + (OraText *) ":FIRSTNAME", -1, (dvoid *) firstname[idx], + firstnm_len, SQLT_STR, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[2], errhp2, + (OraText *) ":LASTNAME", -1, (dvoid *) lastname[idx], + lastnm_len, SQLT_STR, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[3], errhp2, + (OraText *) ":EMAIL", -1, (dvoid *) email[idx], + em_len, SQLT_STR, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[4], errhp2, + (OraText *) ":HIREDT", -1, (dvoid *) hiredate[idx], + strlen((char *) hiredate[idx]) + 1, SQLT_STR, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[5], errhp2, + (OraText *) ":EJOB", -1, (dvoid *) ejob[idx], + job_len, SQLT_STR, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[6], errhp2, + (OraText *) ":ESAL", -1, (dvoid *) &esal[idx], + (sword) sizeof(esal[idx]), SQLT_FLT, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(stmthp, &bndp_arr[7], errhp2, + (OraText *) ":EDEPT_ID", + -1, (dvoid *) &edept_id[idx], + (sword) sizeof(edept_id[idx]), SQLT_INT, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT))) + { + checkerr(errhp2, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; // exit from the thread function + } + + // execute and commit the INSERT statement + status = OCIStmtExecute(svchp, stmthp, errhp2, (ub4) 1, (ub4) 0, + (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_DEFAULT); + if (status != OCI_SUCCESS) { + // INSERT failed! + printf("INSERT failed for employee id: %d\n", empno); + checkerr(errhp2, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; // exit from the thread function + } + + // commit the transaction + checkerr(errhp2, OCITransCommit(svchp, errhp2 ,(ub4) 0)); + + printf("Employee id %d added.\n", empno); + + // cleanup the handles + threadCleanup(svchp, authp, errhp2, stmthp); +} + +/* ----------------------------------------------------------------- */ +/* Fetch and print data from the 'employees' table */ +/* ----------------------------------------------------------------- */ +static void fetchAndPrintData(void) +{ + OraText firstnm[MAX_NAME_LEN_FIRST]; + OraText lastnm[MAX_NAME_LEN_LAST]; + OraText email[MAX_EMAIL_LEN]; + OraText job[MAX_JOB_LEN]; + sword empno; + + // Indicator variables for NULL values (0 for not NULL, -1 for NULL) + sb2 firstnm_ind = 0; // Indicator variable for firstnm + sb2 lastnm_ind = 0; // Indicator variable for lastnm + sb2 email_ind = 0; // Indicator variable for email + sb2 job_ind = 0; // Indicator variable for job + + // OCI handle and pointer declarations + OCISvcCtx *svchp = (OCISvcCtx *) 0; + OCIStmt *stmthp = (OCIStmt *) 0; + OCIError *errhp2 = (OCIError *) 0; // separate error handle for the thread + OCIAuthInfo *authp = (OCIAuthInfo *) 0; + OCIDefine *defnp = (OCIDefine *) 0; + + sword status; + + // SQL statements to execute + OraText *selectstmt = (OraText *) "SELECT employee_id, first_name, last_name,\ + email, job_id FROM EMPLOYEES"; + + // allocate error handle and session authentication information handle + (void) OCIHandleAlloc((dvoid *) envhp, (dvoid **) &errhp2, OCI_HTYPE_ERROR, + (size_t) 0, (dvoid **) 0); + checkerr(errhp2, OCIHandleAlloc((dvoid *) envhp, + (dvoid **) &authp, (ub4) OCI_HTYPE_AUTHINFO, + (size_t) 0, (dvoid **) 0)); + + // set user credentials into the authentication informaton handle + checkerr(errhp2, OCIAttrSet((dvoid *) authp,(ub4) OCI_HTYPE_AUTHINFO, + (dvoid *) username, (ub4) strlen((char *) username), + (ub4) OCI_ATTR_USERNAME, errhp2)); + checkerr(errhp2,OCIAttrSet((dvoid *) authp,(ub4) OCI_HTYPE_AUTHINFO, + (dvoid *) password, (ub4) strlen((char *) password), + (ub4) OCI_ATTR_PASSWORD, errhp2)); + + // get a session from the pool + checkerr(errhp2, OCISessionGet(envhp, errhp2, &svchp, authp, + (OraText *) poolName, (ub4) strlen((char *) poolName), + NULL, 0, NULL, NULL, NULL, OCI_SESSGET_SPOOL)); + + // prepare the SELECT statement + checkerr(errhp2, OCIStmtPrepare2(svchp, (OCIStmt **) &stmthp, errhp2, + (const OraText *) selectstmt, + (ub4)strlen((const signed char *) selectstmt), + NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT)); + + // allocate and define output buffers for the SELECT statement + if (status = OCIDefineByPos(stmthp, &defnp, errhp, 1, + (dvoid *) &empno, (sb4) sizeof(empno), SQLT_INT, + (dvoid *) &firstnm_ind, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT)) + { + checkerr(errhp, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; + } + if (status = OCIDefineByPos(stmthp, &defnp, errhp, 2, + (dvoid *) firstnm, (sb4) sizeof(firstnm), SQLT_STR, + (dvoid *) &firstnm_ind, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT)) + { + checkerr(errhp, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; + } + if (status = OCIDefineByPos(stmthp, &defnp, errhp, 3, + (dvoid *) lastnm, (sb4) sizeof(lastnm), SQLT_STR, + (dvoid *) &lastnm_ind, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT)) + { + checkerr(errhp, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; + } + if (status = OCIDefineByPos(stmthp, &defnp, errhp, 4, + (dvoid *) email, (sb4) sizeof(email), SQLT_STR, + (dvoid *) &email_ind, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT)) + { + checkerr(errhp, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; + } + if (status = OCIDefineByPos(stmthp, &defnp, errhp, 5, + (dvoid *) job, (sb4) sizeof(job), SQLT_STR, + (dvoid *) &job_ind, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT)) + { + checkerr(errhp, status); + threadCleanup(svchp, authp, errhp2, stmthp); + return; + } + + // Execute the SELECT statement + // set the 4th parameter (iters) of OCIStmtExecute to 0 as we do not know + // the number of rows that will be fetched + checkerr(errhp2, OCIStmtExecute(svchp, stmthp, errhp2, (ub4) 0, (ub4) 0, + (OCISnapshot *) 0, (OCISnapshot *) 0, OCI_DEFAULT)); + + printf("\nEmployee Details:\n"); + printf("---------------------------------------------------------------------------------------------------------------------------------\n"); + printf("%-15s %-25s %-25s %-50s %-20s\n","EMPLOYEE ID", "FIRST NAME", "LAST NAME", "EMAIL", "JOB"); + printf("---------------------------------------------------------------------------------------------------------------------------------\n"); + + // Loop until OCI_NO_DATA is returned, indicating no more rows. + while ((status = OCIStmtFetch2(stmthp, errhp, (ub4) 1, OCI_FETCH_NEXT, + (sb4) 0, OCI_DEFAULT)) != OCI_NO_DATA) { + checkerr(errhp, status); + + // Check indicator variables for NULL values and handle them + if (firstnm_ind == -1) { + strcpy(firstnm, "NULL"); + } + if (lastnm_ind == -1) { + strcpy(lastnm, "NULL"); + } + if (email_ind == -1) { + strcpy(email, "NULL"); + } + if (job_ind == -1) { + strcpy(job, "NULL"); + } + + printf("%-15d %-25s %-25s %-50s %-20s\n", empno, firstnm, lastnm, email, job); + } + printf("-------------------------------------------------------------------------------------------------------------------------------\n"); + + // cleanup the handles + threadCleanup(svchp, authp, errhp2, stmthp); +} + +/* ----------------------------------------------------------------- */ +/* Checks for errors and displays them */ +/* ----------------------------------------------------------------- */ +void checkerr(OCIError *errhp, sword status) +{ + OraText errbuf[512]; + sb4 errcode = 0; + + switch (status) + { + case OCI_SUCCESS: + break; + case OCI_SUCCESS_WITH_INFO: + (void) printf("Error - OCI_SUCCESS_WITH_INFO\n"); + break; + case OCI_NEED_DATA: + (void) printf("Error - OCI_NEED_DATA\n"); + break; + case OCI_NO_DATA: + (void) printf("Error - OCI_NODATA\n"); + break; + case OCI_ERROR: + (void) OCIErrorGet((dvoid *)errhp, (ub4) 1, (OraText *) NULL, &errcode, + errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); + (void) printf("Error - %.*s\n", 512, errbuf); + break; + case OCI_INVALID_HANDLE: + (void) printf("Error - OCI_INVALID_HANDLE\n"); + break; + case OCI_STILL_EXECUTING: + (void) printf("Error - OCI_STILL_EXECUTE\n"); + break; + case OCI_CONTINUE: + (void) printf("Error - OCI_CONTINUE\n"); + break; + default: + break; + } +} + +/*---------------------------------------------------------------------*/ +/* Close thread and clean up */ +/*---------------------------------------------------------------------*/ +sword threadCleanup(OCISvcCtx *svchp, OCIAuthInfo *authInfop, + OCIError *errhp1, OCIStmt *stmthp) +{ + checkerr(errhp1, OCIStmtRelease(stmthp, errhp1, (OraText *) NULL, (ub4) 0, + (ub4) OCI_DEFAULT)); + checkerr(errhp1, OCISessionRelease(svchp, errhp1, NULL, 0, OCI_DEFAULT)); + OCIHandleFree((dvoid *) authInfop, OCI_HTYPE_AUTHINFO); + OCIHandleFree((dvoid *) errhp1, OCI_HTYPE_ERROR); + return OCI_SUCCESS; +} diff --git a/C/simpleConnDemo.c b/C/simpleConnDemo.c new file mode 100644 index 00000000..54992759 --- /dev/null +++ b/C/simpleConnDemo.c @@ -0,0 +1,459 @@ +/* Copyright (c) 2025, Oracle and/or its affiliates.*/ +/* All rights reserved.*/ + +/* + * + * NAME + * simpleConnDemo.c - Basic Oracle Call Interface (OCI) functionality + * + * DESCRIPTION + * An example program which adds new employee records to the personnel + * data base. Checking is done to validate the integrity of the data base. + * The employee numbers are automatically selected using the current + * maximum employee number as the start. + * + * The program queries the user for data as follows: + * + * Enter employee name: + * Enter employee job: + * Enter employee salary: + * Enter employee dept: + * + * The program terminates if return key (Enter) is entered + * when the employee name is requested. + * + * If the record is successfully inserted, the following + * is printed: + * + * "ename" added to department "dname" as employee # "empno" + * + * Demonstrates creating a connection, a session and executing some SQL. + * Also shows the usage of allocating memory for application use which has + * the life time of the handle. + * +*/ + +#ifndef OCI_ORACLE +#include +#endif +#include +#include +#include + +// Table specific constants +#define ENAME_MAXLEN 80 +#define JOB_MAXLEN 50 +#define DEPTNAME_MAXLEN 14 + +/* Define the SQL statements to be used in program. */ +static OraText *insert = (OraText *) "INSERT INTO \ + emp(empno, ename, job, sal, deptno)\ + VALUES (:empno, :ename, :job, :sal, :deptno)"; +static OraText *seldept = (OraText *) "SELECT dname FROM dept WHERE \ + deptno = :1"; +static OraText *selmaxemp = (OraText *) "SELECT NVL(MAX(empno), 0) FROM emp"; + +static OCIEnv *envhp = NULL; +static OCIError *errhp = NULL; + +static void checkerr(/*_ OCIError *errhp, sword status _*/); +static void myfflush(/*_ void _*/); +static void free_buffers(/*p_ename, p_job, p_dept*/); +static sword cleanup(/*svchp, authInfop, stmthp*/); + +static sword status; +static boolean logged_on = FALSE; + +/* ----------------------------------------------------------------- */ +/* Main function definition */ +/* ----------------------------------------------------------------- */ +int main(int argc, char **argv) +{ + + sword empno, deptno; + float sal; + sword len, len2; + sb2 sal_ind, job_ind; + OraText *cp, *ename = NULL, + *job = NULL, *dept = NULL; + + // application user to set the database credentials here + char *username = ""; + char *password = ""; + char *connstr = ""; + + OCIAuthInfo *authInfop = (OCIAuthInfo *) 0; + OCISvcCtx *svchp = NULL; + OCIStmt *inserthp = NULL, // for the INSERT statement + *stmthp = NULL; // for the SELECT statements + OCIDefine *defnp = (OCIDefine *) 0; + + OCIBind *bnd1p = (OCIBind *) 0, /* the first bind handle */ + *bnd2p = (OCIBind *) 0, /* the second bind handle */ + *bnd3p = (OCIBind *) 0, /* the third bind handle */ + *bnd4p = (OCIBind *) 0, /* the fourth bind handle */ + *bnd5p = (OCIBind *) 0, /* the fifth bind handle */ + *bnd6p = (OCIBind *) 0; /* the sixth bind handle */ + + sword errcode = 0; + + /** Stage 1: Establish connection to the database */ + + /* set the environment handle */ + errcode = OCIEnvCreate((OCIEnv **) &envhp, (ub4) OCI_DEFAULT, + (dvoid *) 0, (dvoid * (*)(dvoid *,size_t)) 0, + (dvoid * (*)(dvoid *, dvoid *, size_t)) 0, + (void (*)(dvoid *, dvoid *)) 0, (size_t) 0, (dvoid **) 0); + + if (errcode != 0) { + (void) printf("OCIEnvCreate failed with errcode = %d.\n", errcode); + exit(1); + } + + /* allocate error and authentication information handles */ + (void) OCIHandleAlloc((dvoid *) envhp, (dvoid **) &errhp, OCI_HTYPE_ERROR, + (size_t) 0, (dvoid **) 0); + (void) OCIHandleAlloc((dvoid *) envhp, (dvoid **) &authInfop, + (ub4) OCI_HTYPE_AUTHINFO, (size_t) 0, (dvoid **) 0); + + /* set user credentials on the authentication information handle */ + (void) OCIAttrSet((dvoid *) authInfop, (ub4) OCI_HTYPE_AUTHINFO, + (dvoid *) username, (ub4) strlen((char *)username), + (ub4) OCI_ATTR_USERNAME, errhp); + (void) OCIAttrSet((dvoid *) authInfop, (ub4) OCI_HTYPE_AUTHINFO, + (dvoid *) password, (ub4) strlen((char *)password), + (ub4) OCI_ATTR_PASSWORD, errhp); + + /* connect to the database */ + status = OCISessionGet(envhp, errhp, &svchp, authInfop, (OraText *)connstr, + (ub4) strlen((char *)connstr), NULL, (ub4) 0, NULL, + (ub4) 0, FALSE, (ub4) OCI_DEFAULT); + if (status == OCI_ERROR) { + checkerr(errhp, status); + // Clean up the handles, if required + cleanup(svchp, authInfop, inserthp, stmthp); + return OCI_ERROR; + } + + logged_on = TRUE; + printf("Connected to the database successfully.\n"); + + /** Stage 2: Execute the SQL statements */ + + /* retrieve the current maximum employee number */ + checkerr(errhp, OCIStmtPrepare2(svchp,(OCIStmt **)&stmthp, errhp, selmaxemp, + (ub4) strlen((char *) selmaxemp), NULL, 0, + (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT)); + + /* define the output variable for the select-list. */ + checkerr(errhp, OCIDefineByPos(stmthp, &defnp, errhp, 1, (dvoid *) &empno, + (sword) sizeof(sword), SQLT_INT, (dvoid *) 0, + (ub2 *) 0, (ub2 *)0, OCI_DEFAULT)); + + /* execute and fetch */ + if (status = OCIStmtExecute(svchp, stmthp, errhp, (ub4) 1, (ub4) 0, + (const OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT)) + { + if (status == OCI_NO_DATA) // No rows found + empno = 10; + else + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + return OCI_ERROR; + } + } + + checkerr(errhp, OCIStmtRelease((OCIStmt *)stmthp, errhp, (OraText *) NULL, + (ub4) 0, (ub4) OCI_DEFAULT)); + + /* Keep inserting data till the user exits the application */ + for (;;) + { + // the employee name buffer size is ENAME_MAXLEN + 2 to allow for \n & \0 + ename = (OraText *) malloc((size_t) (ENAME_MAXLEN + 2) * sizeof(OraText)); + + /* Prompt for employee name. Break on no name. */ + printf("Enter employee name (or Enter to EXIT): "); + fgets((char *) ename, (int) ENAME_MAXLEN + 1, stdin); + cp = (OraText *) strchr((char *) ename, '\n'); + if (cp == ename) + { + printf("Exiting...\n"); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_SUCCESS; + } + if (cp) + *cp = '\0'; + else + { + printf("Employee name may be truncated.\n"); + myfflush(); + } + + // the job buffer size is JOB_MAXLEN + 2 to allow for \n and \0 + job = (OraText *) malloc((size_t) (JOB_MAXLEN + 2) * sizeof(OraText)); + + /* Prompt for employee job and salary */ + printf("Enter employee job: "); + job_ind = 0; + fgets((char *) job, (int) JOB_MAXLEN + 1, stdin); + cp = (OraText *) strchr((char *) job, '\n'); + if (cp == job) + { + job_ind = -1; // make it NULL in the table + printf("Job is NULL.\n"); // using indicator variable + } + else if (cp == 0) + { + printf("Job description may be truncated.\n"); + myfflush(); + } + else + *cp = '\0'; + printf("Enter employee salary: "); + scanf("%f", &sal); + myfflush(); + sal_ind = (sal <= 0) ? -1 : 0; // set indicator variable + + /* prepare the INSERT statement */ + checkerr(errhp, OCIStmtPrepare2(svchp, (OCIStmt **) &inserthp, errhp, + insert, (ub4) strlen((char *) insert), NULL, + 0, (ub4) OCI_NTV_SYNTAX, (ub4) OCI_DEFAULT)); + + /* bind the placeholders in the INSERT statement */ + if ((status = OCIBindByName(inserthp, &bnd1p, errhp, (OraText *) ":ENAME", + -1, (dvoid *) ename, + ENAME_MAXLEN + 1, SQLT_STR, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(inserthp, &bnd2p, errhp, (OraText *) ":JOB", + -1, (dvoid *) job, + JOB_MAXLEN + 1, SQLT_STR, (dvoid *) &job_ind, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(inserthp, &bnd3p, errhp, (OraText *) ":SAL", + -1, (dvoid *) &sal, + (sword) sizeof(sal), SQLT_FLT, (dvoid *) &sal_ind, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(inserthp, &bnd4p, errhp, (OraText *) ":DEPTNO", + -1, (dvoid *) &deptno, + (sword) sizeof(deptno), SQLT_INT, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT)) || + (status = OCIBindByName(inserthp, &bnd5p, errhp, (OraText *) ":EMPNO", + -1, (dvoid *) &empno, + (sword) sizeof(empno), SQLT_INT, (dvoid *) 0, + (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, OCI_DEFAULT))) + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_ERROR; + } + + /* prepare the "seldept" statement */ + checkerr(errhp, OCIStmtPrepare2(svchp, (OCIStmt **) &stmthp, errhp, + seldept, (ub4) strlen((char *) seldept), + NULL, 0, (ub4) OCI_NTV_SYNTAX, + (ub4) OCI_DEFAULT)); + + /* bind the placeholder in the "seldept" statement */ + if (status = OCIBindByPos(stmthp, &bnd6p, errhp, 1, + (dvoid *) &deptno, (sword) sizeof(deptno), SQLT_INT, + (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0, + OCI_DEFAULT)) + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_ERROR; + } + + /* allocate the dept buffer now that you have length */ + dept = (OraText *) malloc((size_t) (DEPTNAME_MAXLEN + 1) + * sizeof(OraText)); + + /* define the output variable for the select-list. */ + if (status = OCIDefineByPos(stmthp, &defnp, errhp, 1, + (dvoid *) dept, DEPTNAME_MAXLEN + 1, SQLT_STR, + (dvoid *) 0, (ub2 *) 0, (ub2 *) 0, OCI_DEFAULT)) + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_ERROR; + } + + /* + * Prompt for the employee's department number, and verify that the + * entered department number is valid by fetching the corresponding data + * in the 'dept' table. + */ + do + { + printf("Enter employee dept number: "); + scanf("%d", &deptno); + myfflush(); + /* execute the "seldept" statement */ + status = OCIStmtExecute(svchp, stmthp, errhp, (ub4) 1, (ub4) 0, + (const OCISnapshot *) NULL, (OCISnapshot *) NULL, + OCI_DEFAULT); + if (status != OCI_SUCCESS && status != OCI_NO_DATA) + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_ERROR; + } + if (status == OCI_NO_DATA) + printf("The department number you entered doesn't exist.\n"); + } while (status == OCI_NO_DATA); + + /* release the select statement handle */ + checkerr(errhp, OCIStmtRelease((OCIStmt *) stmthp, errhp, (OraText *) NULL, + (ub4) 0, (ub4) OCI_DEFAULT)); + + /* + * Increment empno (which currently holds the highest employee number) + * by 10, and execute the INSERT statement. + */ + empno += 10; + /* execute the INSERT statement */ + status = OCIStmtExecute(svchp, inserthp, errhp, (ub4) 1, (ub4) 0, + (const OCISnapshot *) NULL, (OCISnapshot *) NULL, + OCI_DEFAULT); + if (status != OCI_SUCCESS) + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_ERROR; + } + + /* release the insert statement handle */ + checkerr(errhp, OCIStmtRelease((OCIStmt *) inserthp, errhp, (OraText *) NULL, + (ub4) 0, (ub4) OCI_DEFAULT)); + + /** Stage 3: Commit the change and then free the handles and buffers */ + + if (status = OCITransCommit(svchp, errhp, 0)) + { + checkerr(errhp, status); + cleanup(svchp, authInfop, inserthp, stmthp); + free_buffers(&ename, &job, &dept); + return OCI_ERROR; + } + printf("\n%s added to the %s department as employee number %d\n", + ename, dept, empno); + free_buffers(&ename, &job, &dept); + } +} + +/* ----------------------------------------------------------------- */ +/* Checks for errors and displays them */ +/* ----------------------------------------------------------------- */ +void checkerr(OCIError *errhp, sword status) +{ + OraText errbuf[512]; + sb4 errcode = 0; + + switch (status) + { + case OCI_SUCCESS: + break; + case OCI_SUCCESS_WITH_INFO: + (void) printf("Error - OCI_SUCCESS_WITH_INFO\n"); + break; + case OCI_NEED_DATA: + (void) printf("Error - OCI_NEED_DATA\n"); + break; + case OCI_NO_DATA: + (void) printf("Error - OCI_NODATA\n"); + break; + case OCI_ERROR: + (void) OCIErrorGet((dvoid *) errhp, (ub4) 1, (OraText *) NULL, &errcode, + errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR); + (void) printf("Error - %.*s\n", 512, errbuf); + break; + case OCI_INVALID_HANDLE: + (void) printf("Error - OCI_INVALID_HANDLE\n"); + break; + case OCI_STILL_EXECUTING: + (void) printf("Error - OCI_STILL_EXECUTE\n"); + break; + case OCI_CONTINUE: + (void) printf("Error - OCI_CONTINUE\n"); + break; + default: + break; + } +} + +/* ----------------------------------------------------------------- */ +/* Flushes the characters from standard input */ +/* ----------------------------------------------------------------- */ +void myfflush() +{ + eb1 buf[50]; + + fgets((char *) buf, 50, stdin); +} + +/* ----------------------------------------------------------------- */ +/* Free the query-related buffers */ +/* ----------------------------------------------------------------- */ +void free_buffers(OraText **p_ename, OraText **p_job, char **p_dept) { + if (*p_ename) { + free(*p_ename); + *p_ename = NULL; + } + + if (*p_job) { + free(*p_job); + *p_job = NULL; + } + + if (*p_dept) { + free(*p_dept); + *p_dept = NULL; + } +} + +/*---------------------------------------------------------------------*/ +/* Finish demo and clean up */ +/*---------------------------------------------------------------------*/ +sword cleanup(OCISvcCtx *svchp, OCIAuthInfo *authInfop, OCIStmt *inserthp, + OCIStmt *stmthp) +{ + + if (logged_on) { + if ((status = OCISessionRelease(svchp, errhp, NULL, (ub4) 0, + (ub4) OCI_DEFAULT))) + { + printf("FAILED: OCISessionRelease()\n"); + checkerr(errhp, status); + } + } + + /* Release all statement handles */ + if (inserthp) + (void) OCIStmtRelease((OCIStmt *) inserthp, errhp, (OraText *) NULL, + (ub4) 0, (ub4) OCI_DEFAULT); + if (stmthp) + (void) OCIStmtRelease((OCIStmt *) stmthp, errhp, (OraText *) NULL, + (ub4) 0, (ub4) OCI_DEFAULT); + if (stmthp) + (void) OCIStmtRelease((OCIStmt *) stmthp, errhp, (OraText *) NULL, + (ub4) 0, (ub4) OCI_DEFAULT); + + /* Free all the OCI handles allocated by OCIHandleAlloc and env handle */ + if (authInfop) + (void) OCIHandleFree((dvoid *) authInfop, (ub4) OCI_HTYPE_AUTHINFO); + if (errhp) + (void) OCIHandleFree((dvoid *) errhp, (ub4) OCI_HTYPE_ERROR); + if (envhp) + (void) OCIHandleFree((dvoid *) envhp, (ub4) OCI_HTYPE_ENV); + + OCITerminate(OCI_DEFAULT); + + return OCI_SUCCESS; +}