db2 - 使用 ODBC 在 ACE 11 ESQL 中访问 DB2 数据库
问题描述
我需要在 ESQL、App Connect Enterprise v11 中访问 DB2 数据库。我的腿上安装了一个DB2,可以查询数据。我在 Windows 中添加了一个 ODBC 数据源,并且测试连接成功。在 ace 控制台中,我将 ODBC 资源设置为
mqsisetdbparms ACENODE2 -n odbc::books -u db2root -p nable@123
我的集成节点在哪里ACENODE2
,书籍是我的数据库。我唯一的困惑是我应该在计算节点数据源选项卡中给出模式或数据库名称,我都尝试过但都失败了。
我的 ESQL 代码是
SET OutputRoot.JSON.Data.books[] = SELECT P.BOOK_ID, P.TITLE, P.TOTAL_PAGES, P.ISBN FROM Database.books.books AS P;
其中书籍数据库有一个书籍表。我得到的警告是
Unresolvable database table reference "Database.books.books".
有了警告,我部署了项目,(这是一个从数据库中获取数据的简单 REST API)我得到以下错误作为响应。这里 getAllBooks 是我的消息流。非常感谢任何指导。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>500 Internal Server Error</title>
</head>
<body>
<h1>500 Internal Server Error</h1>
<p>
BIP2230E: Error detected whilst processing a message in node 'gen.TestBase.getAllBooks
(Implementation).Compute'. <br>
BIP2348E: Error detected while attempting to obtain a connection to data source 'db2root' of type 'ODBC' using userid ''.
<br>
BIP2393E: Database error: ODBC return code '-1' from data source 'DB2ROOT' using ODBC driver manager 'odbc32.dll'.
<br>
BIP2322E: Database error: SQL State 'IM002'; Native Error Code '0'; Error Text '[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified'.
</p>
<hr>
</body>
</html>
解决方案
推荐阅读
- reactjs - 有没有类似electron-vue 的react 插件?
- javascript - 我正在使用 html 并有两个按钮。我希望这些按钮具有不同的 typeWriter() 函数输出
- angular - 我希望 Angular 访问 URL 并获取 STL 文件,该文件可用于进一步处理
- android - 如何从广播接收器类调用片段类的处理程序来更新主线程?
- python - 为什么`for _ in 1,1`会迭代两次?
- c - 在 C 中传递指向数组的指针的正确方法是什么?
- magento - magento 1.9 + 脑树
- docker - Gitlab-Runner:从主服务器克隆的权限被拒绝
- sql - Oracle 从 json 读取响应
- scala - 错误:使用 Spark Structured Streaming 读取和写入数据到 kafka 中的另一个主题