I am using ibm_db module to connect to IBM Database using nodejs. I was referring DB2NodeJs. I simply followed this post and used the sample code given in this post. Following were my steps.

1. Installed nodejs
2. Installed ibm_db
3. Downloaded the nodedb2test.js file
4. Changed the database details as per my DB2 database
5. Ran this file.

I am getting following error

error:  [IBM][CLI Driver] SQL1042C  An unexpected system error occurred.  SQLSTATE=58004

I am new to DB2 using Nodejs. Also I think i provided all details correctly except the db2 driver value DRIVER={DB2}. What should be the value for driver? I never installed any database related driver before. Please help.

2

There are 2 best solutions below

3
On

Are you using OSX ? there's an overall problem with db2 when installing the latest 10.10.3 . see here OS X 10.10.3 - SQL1042C An unexpected system error occurred

0
On

I had the same issue. I solved it by adding AUTHENTICATION=SERVER to the connection string.

For example:

DATABASE=XXXX;HOSTNAME=XXXX;PORT=XXXX;PROTOCOL=TCPIP;AUTHENTICATION=SERVER...