How to connect Node.js 14 LTS to Oracle Database 23c FREE using node-oracledb

Veröffentlicht am: 01 Mai 2023
auf dem Kanal: java frm
27
0

In this video we are going to see How to connect Node.js 14 to Oracle Database 23c FREE instance using node-oracledb add-on.
1. First check nodejs is available in commandline (node --version, npm --version).
2. Go to Source code directory in commandline and run "npm install oracledb".
3. Finally run the js program "node oracle23c.js"

Node.js and node-oracledb add-on can be downloaded from:

https://nodejs.org/download/release/v...
https://github.com/oracle/node-oracledb


Below is the program to connect NodeJS to Oracle Database 23c FREE instance.

IMPORTANT NOTE on SOURCE CODE: only source code that are acceptable by the youtube description box will be displayed.
In this program I have replaced the angled brackets with > or <. once you copy the source code to editor replace it with greater than or less than symbols respectively.
#########################SOURCE CODE STARTS HERE##############################
const oracledb = require('oracledb');

async function run() {
let connection = await oracledb.getConnection({
user : "C##Scott",
password : "tiger",
connectString : "localhost:1521/FREE" // [hostname]:[port]/[DB service name]
});
let query = 'SELECT * from person';

connection.execute(query, (err, rows) => {
if(err) throw err;

console.log(rows);
});
}
run();
#########################END OF SOURCE CODE##############################

#nodejs #nodejs14 #nodejstutorial #nodejsoracle #oraclenodejs #nodejsdatabase #nodeoracledb #23c #oracle


Auf dieser Seite können Sie das Online-Video How to connect Node.js 14 LTS to Oracle Database 23c FREE using node-oracledb mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer java frm 01 Mai 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 27 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!