强大的Oracle通过脚本连接
我目前正在testingLoopback并使用Arc接口。
我可以连接到我的oracle数据库,并从所有在浏览器中提供的表创build模型。 (都好)。
但是现在我想要编写一些自定义代码并调用一个oracle过程似乎很困难。 由于没有findoracle模块,我无法连接。 (电弧工作,我已经安装了所有正确的软件包)
我想连接到自定义路由的甲骨文,但不断得到'无法find模块'甲骨文''。
代码示例尝试连接如下;
module.exports = function(app) { app.get('/oracletest', function(req, res) { var settings = {}; var oracle = require("oracle")(settings); var connectData = { "user": "userhere", "password": "passwordhere", "tns": "tnshere" }; oracle.connect(connectData, function(err, connection) { console.log('must have connected woooohoooo'); connection.close(); // call this when you are done with the connection }); }
这是遵循来自strong-oracle的指导,这是一个安装了loopback-oracle-connector的依赖性。
干杯
感谢您收到错字。 模块名称应该是strong-oracle。 请用:
var oracle = require("strong-oracle")(settings);
我刚刚在https://github.com/strongloop/strong-oracle上修复了这个自述文件。