DPI

编程入门 行业动态 更新时间:2024-10-11 17:21:49

<a href=https://www.elefans.com/category/jswz/34/1749186.html style=DPI"/>

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

本文发布于:2024-05-13 13:00:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1759582.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:DPI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!