All Projects → IBM → nodejs-idb-connector

IBM / nodejs-idb-connector

Licence: MIT license
A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax

Programming Languages

javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to nodejs-idb-connector

nodejs-idb-pconnector
Promise-based DB2 Connector for IBM i
Stars: ✭ 22 (-37.14%)
Mutual labels:  db2, ibmi
slack-chatbot-database-watson
Code for the solution tutorial "Build a database-driven Slackbot" (chatbot) with a custom extension in IBM Watson Assistant
Stars: ✭ 23 (-34.29%)
Mutual labels:  db2
Soci
Official repository of the SOCI - The C++ Database Access Library
Stars: ✭ 960 (+2642.86%)
Mutual labels:  db2
Fluentmigrator
Fluent migrations framework for .NET
Stars: ✭ 2,636 (+7431.43%)
Mutual labels:  db2
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (+191.43%)
Mutual labels:  db2
E Commerce Db
Database schema for e-commerce (webstores) sites.
Stars: ✭ 245 (+600%)
Mutual labels:  db2
Experdb Db2pg
eXperDB-DB2PG is a data migration solution that transfers data extracted from various DBMSs to eXperDB or PostgreSQL. Currently, Oracle and Oracle Spatial, MySQL, SQL Server(MS-SQL) and Sybase data can be transferred.
Stars: ✭ 24 (-31.43%)
Mutual labels:  db2
db2-docker
Docker image to run DB2 LUW
Stars: ✭ 37 (+5.71%)
Mutual labels:  db2
ServiceCommander-IBMi
Service Commander for IBM i
Stars: ✭ 29 (-17.14%)
Mutual labels:  ibmi
Obevo
Obevo is a database deployment tool that handles enterprise scale schemas and complexity
Stars: ✭ 192 (+448.57%)
Mutual labels:  db2
Sharding Method
分表分库的新思路——服务层Sharding框架,全SQL、全数据库兼容,ACID特性与原生数据库一致,能实现RR级别读写分离,无SQL解析性能更高
Stars: ✭ 188 (+437.14%)
Mutual labels:  db2
Fhir
The IBM® FHIR® Server and related projects
Stars: ✭ 117 (+234.29%)
Mutual labels:  db2
QshOni
The QShell on IBM i library contains useful CL wrapper commands to allow QShell and PASE apps to be called and consumed from regular IBM i jobs via CL, RPG or COBOL programs.
Stars: ✭ 34 (-2.86%)
Mutual labels:  ibmi
Xeus Sql
xeus-sql is a Jupyter kernel for general SQL implementations.
Stars: ✭ 85 (+142.86%)
Mutual labels:  db2
ILEditor
IBM i development environment (IDE)
Stars: ✭ 83 (+137.14%)
Mutual labels:  ibmi
Eosio sql plugin
EOSIO sql database plugin
Stars: ✭ 21 (-40%)
Mutual labels:  db2
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+6217.14%)
Mutual labels:  db2
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+8214.29%)
Mutual labels:  db2
IBMi-Book
"Learning IBM i as a Web Developer", my subpar eBook for learning the basics of IBM i, RPGLE, Control Language, and more from the eyes of a web developer.
Stars: ✭ 31 (-11.43%)
Mutual labels:  ibmi
Connectors
Connectors simplify connecting to standalone and CloudFoundry services
Stars: ✭ 28 (-20%)
Mutual labels:  db2

Node.js iDB Connector for IBM i

The Node.js iDB Connector is an IBM i Node.js Db2 driver open source project from IBM

NPM

Node-API v3 Badge

Installation

    npm i idb-connector

NOTE This package only installs on IBM i systems.

Then you can require in your code, as shown below.

    const db = require('idb-connector');

Quick Example

Example 1: Fetching data using the exec() API

    const {dbconn, dbstmt} = require('idb-connector');

    const sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';
    const connection = new dbconn();
    connection.conn('*LOCAL');
    const statement = new dbstmt(connection);

    statement.exec(sSql, (x) => {
      console.log(JSON.stringify(x));
      statement.close();
      connection.disconn();
      connection.close();
    });

Example 2: Fetching data using the fetchAll() API

    const {dbconn, dbstmt} = require('idb-connector');

    const sSql = 'SELECT STATE FROM QIWS.QCUSTCDT';
    const connection = new dbconn();
    connection.conn('*LOCAL');
    const statement = new dbstmt(connection);

    statement.prepare(sSql, () => {
      statement.execute(() => {
        statement.fetchAll((x) => {
          console.log(`Result is : ${JSON.stringify(x)}`);
          statement.close();
        });
      });
    });

Example 3: Call stored procedures

    const {dbconn, dbstmt} = require('idb-connector');

    const sql = 'CALL QXMLSERV.iPLUG512K(?,?,?,?)';
    const connection = new dbconn();
    connection.conn('*LOCAL');
    const statement = new dbstmt(connection);

    const ipc = '*NA';
    const ctl = '*here';
    const xmlIn = `<xmlservice><sh>system 'wrksbs'</sh></xmlservice>`;
    const xmlOut = '';

    statement.prepare(sql, () => {
      statement.bindParameters([ipc, ctl, xmlIn, xmlOut], () => {
        statement.execute((out) => {
          for (let i = 0; i < out.length; i += 1) {
            console.log(out[i]);
          }
          statement.close();
          connection.disconn();
          connection.close();
        });
      });
    });

API Reference

Db2 for i Access APIs

Change Log

View CHANGELOG.md file.

Build

Note that building isn't necessary for end-users and is more for developers looking to compile the native Node.js extensions (C code).

    git clone [email protected]:IBM/nodejs-idb-connector.git
    cd nodejs-idb-connector
    npm install --build-from-source

Build Dependencies

Note: sqlcli header files, GCC, and Python are required to compile the code.

    yum install sqlcli-devel
    yum group install 'Development tools' 
    yum install python2

License

MIT

Contributing

Please read the contribution guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].