对于 Linux,可以使用 API 页面 here ,并且连接非常简单。对于 OS X,尝试连接到现有 DB2 数据库时会遇到错误:
{ [Error: [IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004 ] error: '[node-odbc] SQL_ERROR', message: '[IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004\n', state: 'HY000' }
有人知道如何解决这个问题吗?
最佳答案
this issue的最新答案给你答案:
export DYLD_LIBRARY_PATH=/Users/.../<project_folder>/node_modules/ibm_db/installer/clidriver/lib/icc
node app.js
每次进入 shell 时都必须执行此操作,因此您不妨将其放入 .profile 或 .bash_profile 中。
关于node.js - 如何使用 Node JS 连接 DB2 SQL 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30732024/