admin管理员组文章数量:1122851
DPI
我试图建立一个简单的数据库连接,以便从expressnode应用程序中运行sql查询,当我击中我的端点时,我看到以下错误。
message:"DPI-1047: Cannot locate a 64-bit Oracle Client library: "The specified module could not be found". See .html#windows for help\nNode-oracledb installation instructions: .html\nYou must have 64-bit Oracle client libraries in your PATH environment variable.\nIf you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from\n.html\nA Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available.
我在我的代码中所做的就是
result = connection.execute(sql);
我创建了一个小的快递应用程序,我试图调用一个网址在 http:/localhost:3000url 做一个简单的select * from table查询。我不知道为什么我需要安装任何类型的Oracle。这是我的完整代码。
var express = require("express");
var expressapp = express();
var oracledb = require('oracledb');
var dbConfig = require('./dbconfig.js');
expressapp.listen(3000, () => {
console.log("Server running on port 3000");
});
expressapp.get("/url", (req, res, next) => {
let connection, result, sql;
sql = `SELECT * FROM user_table WHERE FNAME = 'TEST'`;
binds = {};
// For a complete list of options see the documentation.
options = {
outFormat: oracledb.OUT_FORMAT_OBJECT // query result format
// extendedMetaData: true, // get extra metadata
// fetchArraySize: 100 // internal buffer allocation size for tuning
};
connection = oracledb.getConnection({
user : "xxxxx",
password : "xxxxx",
connectString : "xxxxxxxxxxxxxxx"
});
result = connection.execute(sql);
console.log("Response: ");
console.log(result);
res.json(result);
});
回答如下:oracle 'oracledb' 驱动程序 (节点-oracledb) 需要Oracle客户端 来连接数据库。
你可以在 https:/www.oracledatabasetechnologiesinstant-client.html
本文标签: DPI
版权声明:本文标题:DPI 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1715586655a830488.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论