天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2653|回复: 0

[源码] 如何在jsp页面中获取数据源

[复制链接]
myApps 发表于 2016-7-8 16:40:55 | 显示全部楼层 |阅读模式
Q:如何在自己写的jsp页面中调用平台的数据源并查询数据?
A:以下是在jsp页面中,获取数据源,并查询数据库的方法,可以参考一下
<%
                DataSourceProcessBean  bean  = new DataSourceProcessBean();
               
               
                String applicationid = "11e4-a82f-5ee0afbe-9eb9-b7c5c8e327bc";

                Collection<Map> aa = (Collection<Map>)bean.queryDataSourceSQL("obpm_oa","select * from tlk_xxxxx",applicationid);
                String html = "<ul id='ulList'>";
               
                for(Iterator<Map> iter = aa.iterator();iter.hasNext();){
                        Map m = iter.next();
                        String title = (String)m.get("item_name");
                        html += "<li class='left_icon' type='"+title+"' ><a href='#'>";
                        html += title;
                        /* String create = (String)m.get("item_title"); */
                        html += "</a></li>";
                }
                html += "</ul>";
                out.println(html);
                %>

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 14:11

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表