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);
复制代码 |