mysql - MobileFirst 适配器 : JSON result order is different as that of the DB data position

标签 mysql json adapter ibm-mobilefirst mobilefirst-adapters

我已经创建了一个 logintable,其中包含用户名和密码作为其列。 我已经在 MobilFirst 环境 中配置了适配器。调用适配器时,我得到以下输出:

Invocation Result of procedure: 'procedure1' from the MobileFirst Server: 
{
   "isSuccessful": true,
   "resultSet": [
  {
     "pwd": "Harry123",
     "usrname": "Harry"
  }
 ]
}

但在我的数据库中,用户名在前,然后是密码。

我的数据库结构:

usrname varchar(20)

pwd varchar(20)

能否请您告诉我为什么调用结果中数据的顺序或位置不同。

提前致谢!!

最佳答案

适配器将响应转换为 JSON 并将其发送回客户端。

JSON 是 unordered .
这意味着在您的响应中,{a:1,b:2} 与 {b:2,a:1} 完全相同。

这是响应的预期方式。

关于mysql - MobileFirst 适配器 : JSON result order is different as that of the DB data position,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28744910/

相关文章:

php - 带有引号/撇号变体的 wordpress 查询

java - JDBC + MYSQL 通信链接失败

php - 为什么我的 SQL 脚本停止了?

ios - 如何使用 Alamofire swift 3 从这个 JSON 中获取值

android - Listview 设置适配器 fragment 空指针异常

c++ - 适配器模式的实现问题

MySQL 日期比较

javascript - 显示带有来自 json 的真实值的复选框

android - 如何解析四方类别json

android - 从另一个类访问 onCreate 中的 ArrayAdapter