Skip to content

Instantly share code, notes, and snippets.

@neurotech

neurotech/app.js Secret

Created March 14, 2014 01:02
Show Gist options
  • Save neurotech/383ff54d651168fd25c6 to your computer and use it in GitHub Desktop.
Save neurotech/383ff54d651168fd25c6 to your computer and use it in GitHub Desktop.
var jdbc = require('jdbc');
var config = {
libpath: __dirname + 'drivers/db2jcc.jar',
drivername: 'com.ibm.db2.jcc.DB2Driver',
url: 'jdbc:' + 'db2://url:port/PATH' + ':user=' + 'user' + ';password=' + 'secret' + ';'
};
jdbc.initialize(config);
jdbc.on("init", function(res, err) {
if (err) {
console.log(err);
}
});
jdbc.open();
jdbc.on("open", function(conn, err) {
jdbc.execute("SELECT * FROM table");
jdbc.on("execute", function(err, results) {
console.log(results);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment