node.js manage communication with the DB2 database - node.js

how can i manage communication with the database in node.js?
is there any module that can i use??
i need to get adn store data from DB2 on IBM i.
At the moment i'm using Zend Framework but i want replace my php function to get store from database, to use javascript in server side with node.js
Is this a good idea? can someone give me advice if this way is efficent in terms of speed of access to the database??
i see a list of module as: MongoDB, CouchDB and Redis but DB2 is supported? wich i can choose?
thanks!

I think you can use node-odbc module.
Today I succeed connecting to AIX5.3 DB2 server(V8.X) from linux machine(ubuntu 10.10) using node.js
I've installed and configured below...
1) node-odbc
2) unixODBC
3) db2 runtime client

Not sure if you are still looking for a solution. Thought would reply so that it will be useful for others who hit the thread.
As ryuken has mentioned you can setup node-odbc to talk to DB2 and it works fine. You can refer to the blog post "Using IBM DB2 from node.js" on configuring node.js with DB2 using node-odbc.
Thanks
Praveen

Related

How can i connect to mongodb database with native nodejs without using the official MongoDB Node.js Driver?

I searched many answers through google, but all suggestions are to install mongodb through npm. Then i tried to analyze MongoDB Node.js Driver source code, where are mongodb library. And found that it seems to be implemented through nodejs's native net module. Can someone give me some pointers, thank you for your suggestions.
You can connect to mongod/mongos's ports using your favorite socket library and speak the raw protocol directly. The handshake is described here. OP_MSG which is used with 3.6 and newer servers is described here. See also this. You may need to read some driver source to figure out how to attach everything together (for example, the messages need to be serialized to bson for transmission over the wire).

Can I connect my python script with Oracle database without downloading its client?

I have an old program which uses cx_Oracle with Oracle 11g. This program is not portable as the user need to download Oracle 11g in order to use it. Is it possible to use Oracle database in my script but without downloading it, may be by using any online database?
Oracle software can be downloaded from the Oracle Technology Network, here.
If you want to use an online database, Oracle offers Oracle Cloud Free Tier, but I don't think it offers 11g as it is quite old (will be desupported soon). Also, I don't know whether you can (or can not) connect your Python application to it; you'll have to contact Oracle or wait for someone else who knows that info.
Maybe someone hosts 11g, but I doubt that it is for free so - maybe your best option is to download and install free Oracle 11g Express Edition (XE).
After reading your problem, What I understood is that you need a portable database. Since your scripts are connected to Oracle 11g with cx_Oracle , I guess you used SQL queries everywhere.
I suggest you to use SQLite instead of cx_Oracle if you are in a hurry. Both have kinda similar syntax for executing queries though you may need to modify some keyword.
To start quickly refer https://docs.python.org/3/library/sqlite3.html

What is best ORM framework to use with NodeJS and Informix DB. Also Support for Transaction management

Actually I'm planing to use NodeJS for web application development, my back-end DB is Informix, I'm looking for the ORM framework which best fit for Nodejs and also supports DB Transaction. Previously I used MyBatis with JAVA and Spring I'm wondering whether it supports or not.
Also it is very helpful if someone can provide an example/sample implementation fro CRUD operation using Informix, NodeJS (with or with out ORM)
I searched google with no luck. Appreciate your help. Thanks In advance
Here are some examples in multiple languages (java, javascript, python, etc) to help you get started with app development against Informix backend - https://github.com/ibm-informix/informix-client-examples
Web app development against Informix should be greatly simplified since REST APIs are available for accessing data in relational tables as well as collections. Here is a tutorial on the Informix REST APIs - http://www.slideshare.net/BrianHughes70/informix-rest-api-tutorial

How can I connect my Node.js application to MongoDB without using native modules?

We can accept 20 times slower to avoid using python or C++ in our project. Are there a native module that still works?
There is no need to invent wheel. mongodb package is the simplest one
But if You insist there are many ways:
Easy way: You can use Rest API of mongo and do requests to it using request package
Moderate way: Open mongodb-core package and copy out what You need most, make Your own mongodb class.
Moderate way #2: fork mongodb package, manipulate it and save with new repository name
Hard way: If You want go hardcore (: read mongodb protocol and operate with it using net package to open socket connection to mongodb server.
How about Crest? It's a node wrapper around the MongoDB server that provides a REST API. With it you could talk to MongoDB over REST instead of with a native client, similar to CouchDB.
There are some other utilities listed here. Maybe you're okay with using Python outside of your app but in front of MongoDB to provide the REST API? If so then maybe those are some alternatives if you don't like Crest. Haven't used it myself so I can't vouch for its quality, but it is listed on MongoDB's own list so hopefully it's decent.

node.js sybase driver

I am developing an app using node.js express framework and would need to connect to sybase ASE database. I did enough search and couldn't find the sybase driver for node.js. doesn't node.js support sybase or should I use something like a generic driver?
An exhaustive list of database drivers is on the node.js wiki here:
https://github.com/joyent/node/wiki/Modules#wiki-database
But no Sybase so that leaves using an ODBC driver which, if on *nix, then you have the option of:
https://github.com/w1nk/node-odbc
Alternatively, Sybase ASE has it's own web services engine which exposes SQL and stored procedures through a SOAP API. Your best option may be to just roll your own SOAP client in node against that API, perhaps using node-soap.
As of 2015, a non-odbc implementation based on Jconnect is available. It requires Java.
You can install it with
npm install sybase
More info:
https://www.npmjs.com/package/sybase
I know it has been a while, but if you are still looking, try this:
https://www.npmjs.org/package/sqlanywhere
node.js comes with no DB support at all.
DB connectors are out of the scope of the node.js distribution. But the cummunity fills the gap here e.g. for mysql there is node-mysql.
Problem here is that you want to use a DB without a big (open source) community, so, after some googeling, there is no node.js connector.
If you want to create a connector for sybase ASE you might have a look at node-mysql to get startet. But this is nothing you do in one weekend.

Resources