Open ewu1209 opened 10 years ago
The value for the database field needs to be the service_name, not SID. Basically the listener on the database server does not know about the service named "FF234J" in your example. You can get a list of services that your listener knows about by logging on to the database server and issuing the "lsnrctl status" command
Awesome, thank you for the response.
Does anyone know why I am receiving this error message? I am successfully able to connect to this database using Navicat or SqlDeveloper using the exact same parameters. I am also successfully able to connect to a different database using different connection string parameters.
var sys = require('sys'); var oracle = require('oracle');
var connectData = { hostname: "11.6.309.144", port: 1521, database: "FF234J", // System ID (SID) user: "BLAHUSERNAME", password: "BLAHPASSWORD"
};
exports.dumpData = function (req, res) { var sql = "SELECT * from BEATS where rownum < 3";
oracle.connect(connectData, function(err, connection) { if (err) { console.log("Error connecting to db:", err); return; } connection.execute(sql, [], function(err, results) { if (err) { console.log("Error executing query:", err); return; } res.json(results); connection.close(); }); });
};