zoukankan      html  css  js  c++  java
  • jdbc 与 each controller 对多条查询结果的处理

    这里 userid 是从前面 sql语句中查到的其中一个字段的结果

    这里设置变量的前缀,即使用userid进行循环,输出变量名称为 current_userid 

    假设另外一个变量的名字为mobile, 则在for each循环器中,我们可以使用mobile_1,mobile_2.....来获得mobile这个值的内容

    这里我们需要使用一个 __V功能,它可以将两个变量进行组合

    he V (variable) function returns the result of evaluating a variable name expression. This can be used to evaluate nested variable references (which are not currently supported).

    For example, if one has variables A1,A2 and N=1:

    • ${A1} - works OK
    • ${A${N}} - does not work (nested variable reference)
    • ${__V(A${N})} - works OK. A${N} becomes A1, and the __V function returns the value of A1
      

    这个功能很有用, ${__V(mobile_${__counter(,)})}  这里就会返回 mobile_1 , mobile_2等的值.

  • 相关阅读:
    策略模式
    装饰模式
    责任链模式
    算法_快速排序
    算法_二分查找
    数据结构学习笔记_表
    集合遍历remove时ConcurrentModificationException异常
    LinkedHashMap笔记
    Windows相关命令
    高效率幂运算
  • 原文地址:https://www.cnblogs.com/yingchen/p/5124929.html
Copyright © 2011-2022 走看看