Connect to Oracle DB

suggest change

A very easy way to connect to an ORACLE database is by using oracledb module. This module handles the connection between your Node.js app and Oracle server. You can install it like any other module:

npm install oracledb

Now you have to create an ORACLE connection, which you can later query.

const oracledb = require('oracledb');

oracledb.getConnection(
  {
    user          : "oli",
    password      : "password",
    connectString : "ORACLE_DEV_DB_TNS_NAME"
  },
  function (err, connection) {
    if (err) throw err;
    // Query with connection, then call connection.close().
  }
);

The connectString value ORACLE_DEV_DB_TNS_NAME may be an entry in a tnsnames.ora file, in the process's current directory or where Oracle Instant Client is installed.

If Oracle Instant Client is not installed on your development machine, follow the Instant Client installation guide for your operating system.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents