Connecting to an Oracle Database Using Node.js Windows

I am trying to connect to an Oracle database from Node.js on Windows 7. Is this possible? I have not found a plugin for Node.js that will do this for Windows. Are there any recommendations for this? I assume that there is at least one person who wants to use Node.js on Windows and needs to connect to Oracle. I am open to simple workarounds if necessary. Thanks for the help.

+6
source share
5 answers

Do you need to directly connect from Node.js to oracle? You can write database transactions in another language and provide them to Node.js through a web service.

+2
source

There is a driver created by Oracle oracledb http://www.oracle.com/technetwork/database/database-technologies/node_js/oracle-node-js-2399407.html

UPDATE: Oracle has released a node-oracledb on GIT that will allow the nodejs application to connect to the Oracle window.

+1
source

The state of the database drivers for node.js on Windows seems somewhat immature compared to the reliable and high-performance database drivers that we have had in ADO.NET for several years now.

I would seriously consider using Edge to call C # or build the CLR in the process to access your database. You can write a Repository level of access to style data in C # and call it from node.js.

I have proven that this works in the context of development with C #, PetaPoco (optional), .NET 4.5 and Oracle ODP driver (Oracle.DataAccess.dll). This should also work with any database you can talk to in .NET.

Node (server.js) to call the .NET CLR function:

 var edge = require('edge'); // define CLR function proxy var getData = edge.func({ assemblyFile: '../Repositories/bin/Debug/Repositories.dll', typeName: 'Repositories.TestRepository', methodName: 'GetData' // This must be Func<object,Task<object>> }); // call proxy function getData({ myParam:1 }, function (error, result) { if (error) throw error; console.log(result); }); 

GetData C # looks like this (note that you need to put the connection string in node.exe.config in the folder containing node.exe):

 public async Task<object> GetData(object param) { using (var db = new Database("NameOfConnString")) { return db.Fetch<dynamic>("SELECT * FROM sometable"); } } 

(Note that the Oracle.DataAccess.dll file must be located in the folder containing node.exe.)

+1
source

http://github.com/mariano/node-db-oracle This project aims to add oracle support for nodejs

EDIT: Currently, Oracle uses the node nodejs driver, an Oracle called node -oracle

https://blogs.oracle.com/opal/entry/introducing_node_oracledb_a_node

0
source

This driver works in the window: https://npmjs.org/package/oracle

A similar question, as you have here, about stack overflow: Connect Node.js to Oracle platform on Windows platform

0
source

Source: https://habr.com/ru/post/912427/


All Articles