I tried to connect oracle DB with nodejs, and I got the message as below:
ORA-12560: TNS:protocol adapter error
This is my code:
oracledb.getConnection(
{
user:"user",
password:"password",
ConnectString:"IP:PORT/instance_name"
},
function(err, connection) {
if (err) {
console.error(err.message);
return;
}
console.log('Connection was successful!');
connection.close(
function(err) {
if (err) {
console.error(err.message);
return;
}
});
});
Please check whether environment for oracle has been set to your local machine and test this code