現在、私はバックエンドでoracle
を実行する必要があるプロジェクトに取り組んでいます。私は与えられたlinkを使用し、node-oracledbをnpmを使用して私のMacにインストールしました。私は、ノードのバージョンを使用していますノードoracle-db npm packagaeを使用中にORA-12514エラーが発生しました
var oracledb = require('oracledb');
oracledb.getConnection(
{
user : 'username',
password : 'password',
connectString : 'username/password//hostname:port/sid'
function(err, connection)
{
if (err) {
console.error(err.message);
return;
}else{
connection.execute(
"SELECT * from TableName",
function(err, result)
{
if (err) { console.error(err); return; }
console.log(result.rows);
});
}
});
私はノードfilename.jsを実行すると、私は次のエラー
ORA-12154: TNS:could not resolve the connect identifier specified
を取得し、次のように内容は私のファイルがv7.0.0
で、NPMのバージョンがv3.10.8
です。また、私のOracleデータベースは、クラウド上の11g
インスタンスです。誰かが私に間違っていることを教えてもらえますか?
私はこの問題が解決されましたが、私は同様の問題に直面しています知っています。私はノードoracledbで方向の言及をフォローしました。私はinstantclient basicとsdkをインストールしてパスを設定しました。 Oracle 11g Expressをインストールするとすぐにエラー「oracledb module not found」が表示されます。 11g Expressをアンインストールすると、エラー「ORA-12541:TNS:no listener'」が表示されます。 11gをインストールする方法と接続文字列を教えてください。 – user557657