I've followed the instructions: https://www.ibm.com/developerworks/community/blogs/pd/entry/using_ibm_db2_from_node_js4?maxresults=15&page=0&lang=en for a 32-bit install of Ubuntu.
It seems to have installed correctly and I can run require('ibm_db'). Using the sample code provided (nodedb2test.js), no matter what database parameters I use I get the error:
node nodedb2test.js
Test program to access DB2 sample database
*** stack smashing detected ***: node terminated
Aborted (core dumped)
Heres the sample code:
/*require the ibm_db module*/
var ibmdb = require('ibm_db');
console.log("Test program to access DB2 sample database");
ibmdb.open("DRIVER={DB2};DATABASE=testdb;UID=username;PWD=password;HOSTNAME=localhost;port=3000", function(err, conn)
{
if(err) {
console.error("error: ", err.message);
}
});
Also I looks the version of DB2 I need to connect to is version 6. I have installed BM Data Server Driver version 10.5, does this correspond to the version of DB2? It appears below v9.1 drivers are not available.