JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q46217F

Implementation http://jt400.sourceforge.net/ on JavaScript

Package Exports

  • jt400

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jt400) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jt400 Dependency Status NPM version

NPM

========

Download jt400.jar and copy in your path.

More info: http://jt400.sourceforge.net/

Install

npm install jt400

app.js

var db = require('jt400');

var config = {
    libpath: __dirname + '/jt400.jar',
    drivername: 'com.ibm.as400.access.AS400JDBCDriver',
    url: 'jdbc:as400://127.0.0.1/myDatabase;user=myUser;password=myPassword'
};

db.initialize(config);

db.execute('SELECT * FROM users');

db.on('execute', function(error, results){
    if( error ){
        console.log(error);
    }
    else{
        console.log( results );
    }
});

//INSERT and UPDATE statements must be run with executeUpdate()
db.executeUpdate("INSERT INTO users (name) VALUES ('bob')");

db.on('executeUpdate' function(error, rowCount) {
    if( error ){
        console.log(error);
    }
    else{
        console.log( rowCount );
    }
});

Run

node app.js

Based on https://npmjs.org/package/jdbc