I Think I'm Missing Something Obvious about DB Access

114 views
Skip to first unread message

Gary Furash

unread,
Mar 12, 2015, 8:23:17 PM3/12/15
to nod...@googlegroups.com
Given an Oracle DB, it seems my choices are the node-oracledb (which isn't part of NPM) and node-jdbc, both of which seem to require an inordinate amount of prerequisites (e.g., getting the right C++ compiler, python, etc.). Is there a simpler way of connecting to a DB via NODE, a la JDBC (e.g., you just need a jar file for the db).

Aria Stewart

unread,
Mar 12, 2015, 9:03:55 PM3/12/15
to nod...@googlegroups.com

> On 12 Mar 2015, at 18:37, Gary Furash <furas...@gmail.com> wrote:
>
> Given an Oracle DB, it seems my choices are the node-oracledb (which isn't part of NPM) and node-jdbc, both of which seem to require an inordinate amount of prerequisites (e.g., getting the right C++ compiler, python, etc.). Is there a simpler way of connecting to a DB via NODE, a la JDBC (e.g., you just need a jar file for the db).


Any connector written in Javascript won't need the build infrastructure, so things like node-mysql2 work just fine without any compiler. That means the actual protocol implementation in Javascript.

However, most databases provide a C or C++ library that must be linked to, and that requires building something that can be linked to from node/v8. That means C++, the compiler for that, and python about 2.7 to run node-gyp.

Then there's JDBC, which is worse, since the C++ runtime has to be bridged to Java, I'd expect via JNI, so you'd need a C++ compiler, python, _and_ java SDK to boot.

So TL;DR: some things are as simple as install a plain js module. Oracle? Possibly not.

Aria

Christopher Jones

unread,
Mar 18, 2015, 8:43:11 PM3/18/15
to nod...@googlegroups.com


On Thursday, March 12, 2015 at 5:23:17 PM UTC-7, Gary Furash wrote:
Given an Oracle DB, it seems my choices are the node-oracledb (which isn't part of NPM) and node-jdbc, both of which seem to require an inordinate amount of prerequisites (e.g., getting the right C++ compiler, python, etc.). Is there a simpler way of connecting to a DB via NODE, a la JDBC (e.g., you just need a jar file for the db).

If you are speaking about Windows, yes installing has a few steps.  This is typical for Windows.

On Linux life is much, much easier.  You download and install two, smallish, free Oracle Instant Client RPM packages.
Then installing node-oracledb doesn't require anything special e.g. no environment variables need to be set at build or runtime.
You just 'npm install' and start using it.  See the install instructions in the repo https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#instrpm

There is an unofficial node-oracledb release on NPM.  An official one will be coming soon.

Will Hoover

unread,
Mar 19, 2015, 10:59:53 AM3/19/15
to nod...@googlegroups.com

So, is the "official one" that's coming soon different than the existing https://www.npmjs.com/package/oracledb ?

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/bc0fadf7-762f-4280-a5f6-a8d2edf09320%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Jones

unread,
Mar 19, 2015, 11:23:07 AM3/19/15
to nod...@googlegroups.com


On Thursday, March 19, 2015 at 7:59:53 AM UTC-7, Will Hoover wrote:

So, is the "official one" that's coming soon different than the existing https://www.npmjs.com/package/oracledb ?


The person who posted it says it is the same code base: https://github.com/oracle/node-oracledb/issues/1#issuecomment-74736597

Chris

Christopher Jones

unread,
Mar 28, 2015, 9:47:40 PM3/28/15
to nod...@googlegroups.com
The latest node-oracledb 0.4.2 is now officially on https://www.npmjs.com/package/oracledb

Chris

Will Hoover

unread,
Mar 30, 2015, 7:53:43 AM3/30/15
to nod...@googlegroups.com

Thanks Chris!

Reply all
Reply to author
Forward
0 new messages