<commit_before># jt400 [![Dependency Status](https://david-dm.org/patriksimek/jt400.png)](https://david-dm.org/patriksimek/jt400) [![NPM version](https://badge.fury.io/js/jt400.png)](http://badge.fury.io/js/jt400)

[![NPM](https://nodei.co/npm/jt400.png)](https://nodei.co/npm/jt400/)


========

Download [jt400.jar](http://sourceforge.net/projects/jt400/) and copy in your path.

More info: [http://jt400.sourceforge.net/](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=<PASSWORD>'
    };
    
    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( results );
        }
    });

# Run
    node app.js

Based on [https://npmjs.org/package/jdbc](https://npmjs.org/package/jdbc)<commit_msg>fixed typos in README<commit_after># jt400 [![Dependency Status](https://david-dm.org/patriksimek/jt400.png)](https://david-dm.org/patriksimek/jt400) [![NPM version](https://badge.fury.io/js/jt400.png)](http://badge.fury.io/js/jt400)

[![NPM](https://nodei.co/npm/jt400.png)](https://nodei.co/npm/jt400/)


========

Download [jt400.jar](http://sourceforge.net/projects/jt400/) and copy in your path.

More info: [http://jt400.sourceforge.net/](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=<PASSWORD>'
    };
    
    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](https://npmjs.org/package/jdbc)
{'fraction_non_alphanumeric': 0.17612252001392273, 'fraction_numerical': 0.03967977723633832, 'mean_word_length': 2.513447432762836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3328797', 'n_tokens_mistral': 1116, 'n_tokens_neox': 964, 'n_words': 156}