Database name not found

79 views
Skip to first unread message

Jonas Kello

unread,
Oct 23, 2017, 9:58:08 AM10/23/17
to node-ibm_db
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?

My problem is similar to https://groups.google.com/forum/#!topic/node-ibm_db/hEqCeS7cyyY but that has no resolution that I could find.

bimaljha

unread,
Oct 23, 2017, 12:10:28 PM10/23/17
to node-ibm_db
The error says that the name of target AS400 database is not correct. Many applications are using ibm_db to connect to AS400 server and it works fine! In JDBC application you might have cataloged the remote database using some alias name and MYDB seems some alias name for the remote database not the actual database name. The catalog used to JDBC application is not accessible to the ibm_db. Please contact your AS400 system administrator to know the correct database name. Thanks.
Reply all
Reply to author
Forward
0 new messages