First of all thank you for providing this package!
I'm tasked with extracting some data from a iSeries database and I would like to use JS to do it so this package is very useful :-).
So I have a iSeries database on a remote that I need to connect to. I have no admin access to it, I'm just an outside application developer.
First I tried to connect from a query tool which uses JDBC drivers (DBeaver) and that worked fine so I am sure my connection details are correct.
Next I tried to connect to it using the ibm_db package like this (obviously MYDB etc are just placeholders for my actual connection details):
var ibmdb = require("ibm_db");
ibmdb.open(
"DATABASE=MYDB;HOSTNAME=MYHOST;UID=MYUID;PWD=MYPWD;PORT=446;PROTOCOL=TCPIP;",
function(err, conn) {
if (err) return console.log(err);
conn.close(function() {
console.log("done");
});
}
);
When running the above program I get the following error:
{ Error: [IBM][CLI Driver] SQL30061N The database alias or database name "MYDB " was not found at the remote node. SQLSTATE=08004
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] SQL30061N The database alias or database name "MYDB " was not found at the remote node. SQLSTATE=08004\
r\n',
state: '08004' }
To troubleshoot I tried changing the password to somthing invalid and then I get this error:
{ Error: [IBM][CLI Driver] SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001
errors: [],
error: '[node-odbc] SQL_ERROR',
message: '[IBM][CLI Driver] SQL30082N Security processing failed with reason "24" ("USERNAME AND/OR PASSWORD INVALID"). SQLSTATE=08001\r\n',
state: '08001' }
So it seems the authentication at least is working but somehow it is not able to find my database name.
I use the same database name, user, pwd etc. in my ibm_db connectionstring as in the JDBC based query tool where it is working.
Is there something special I have to add to the database name in order for the ibm_db package to work?