教育网研究 根据一级id显示下面所有级id

news/2024/7/7 15:24:17 标签: 教育, string, list

 String thirdid=dbo.nextID("7");   // thirdid为11,12,13,14,34,多了一个逗号,下面蓝色的部分是进行处理
 String hqldown="from Source_inf where in ("+thirdid.substring(0,(thirdid.length()-1))+") order by neworders";

DBOperator的一个方法如下
  /**
   * 根据source_type的id判断是下级的id ,现在收录第三级的id
   *
   */
  public String nextID(String id)
  {  
  String myid=id+",";
//  Source_type
//   hql="from Source_type where id="+level;
  String hql="from Source_type where levels="+id;
 // this.setLength(20);
  List secondidL=this.findSQLHibernate(hql, 1);
  Source_type  mytype2=new Source_type();
  Source_type  mytype3=new Source_type();
  for(int q=0;q<secondidL.size();q++)
   {
   mytype2=(Source_type)secondidL.get(q);
  int thisid=mytype2.getId();
  String hql2="from Source_type where levels="+thisid;
  List thirdidL=this.findSQLHibernate(hql2, 1);
   for(int a=0;a<thirdidL.size();a++)
    { mytype3=(Source_type)thirdidL.get(a);
       int thirdid=mytype3.getId();
       myid+=thirdid;
       myid+=",";

    }
   }
 
  return myid;
 
  }


http://www.niftyadmin.cn/n/1425878.html

相关文章

servlet学习 Cookie,页面计数

servlet API Filter,response.Cookie,request....1.myeclipse中可自动生成servlet 使用web.xml中的<url-pattern>中的内容就可以了。对掉最前面一个"/"&#xff0c;要不然就指到根目录去了 2 .request.getContextPath() 返回上下文路径 即发布名称3 Cookieim…

实用javabean 从注册到现在有几天,取时间,取中文

1.从注册到现在有几天DBOperator的一个方法 public int getTime1ToTime2(String Time1) { String StrDateTime1; int iStrDate.indexOf("-"); String ip1StrDate.substring(0,i); StrDateStrDate.substring(i1,StrDate.length()); iStrDate.indexOf("-"…

网站统计 季风流量统计系统

网站统计使用季风流量统计系统只要在每个页面中加入如下一句话就可以了 ,红色的地方替换成你数据库中的&#xff08;InfoList表中你设置的一条信息的admin字段.&#xff09; <jsp:include pagestat.jsp?idfacepp flushtrue/>

javamail 发邮件所需jar 包两个 activation.jar,mail.jar

javamail所需jar 包两个 activation.jar,mail.jar(放在邮箱里了) index.jsp 填写相关信息。用来发邮件的邮箱和密码一定要写对<% page contentType"text/html; charsetgb2312" language"java" errorPage"../error/error.jsp" %><!DOCT…

鲤鱼论坛mysql4.0+tomcat.rar

鲤鱼论坛mysql4.0tomcat.rar 附件 无中文乱码演示地址http://www.liyunet.com/bbs/index.jsp如果出现乱码&#xff08;JAVA的特权&#xff09;&#xff0c;请修改/WEB-INF/systemconfig.properties文件的#####################################################$######编码转…

JSF学习1

事件和监听器模型&#xff0c;用户界面组件&#xff0c; (通常使用Renderer灵活地表示 UI?)体系结构也是MVCFacesServlet Lifecycle ,FacesContextJSF户界面模型 UI组件类事件和监听器模型 显示模型验证模型 转换模型 组件显示模型组件的功能通常围绕着两个动作&…

嵌入页面的美化了的播放器和点击弹出多种格式的网页视频播放程序

1.嵌入页面的美化了的播放器播放FLV的 (JW FLV Media Player)http://www.jeroenwijering.com/upload/mediaplayer-3-16.zip 播放wmv的(JW WMV Player)http://www.jeroenwijering.com/upload/wmvplayer-1-0.zipREADME.HTML就是示例源文 http://www.jeroenwijering.com/ 点击顶部…

基于PAJ7620的主从机通信远程控制蓝牙智能小车

这是大三上传感器大作业做的一个主从机控制小车。期间参考了网上的一些博客&#xff0c;涉及主从机通信、蓝牙配置、传感器的使用等。 文章目录一、实物图片二、系统架构三、主要外设四、手势控制对应关系五、应用场景与待改进六、参考文章七、代码实现一、实物图片 二、系统架…