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

Published: 01 May 2023
on channel: 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


On this page of the site you can watch the video online How to connect Node.js 14 LTS to Oracle Database 23c FREE using node-oracledb with a duration of hours minute second in good quality, which was uploaded by the user java frm 01 May 2023, share the link with friends and acquaintances, this video has already been watched 27 times on youtube and it was liked by 0 viewers. Enjoy your viewing!