"DRP"-Dynamic stitching number

Source: Internet
Author: User

/** * Recursive read distributor tree * Fourth step: Use div to generate tree structure * @param conn * @param ID * @param level control levels */PR ivate void Readclienttree (Connection conn, int id, int level) throws SQLException {String sql = ' SELECT * FROM T_client where pid=? "; PreparedStatement pstmt = null; ResultSet rs = null; try {pstmt = conn.preparestatement (sql); Pstmt.setint (1, id); rs = Pstmt.executequery (); while (Rs.next ()) {Sbtreehtml.append ("<Div>"); Sbtreehtml.append ("\ n"); for (int i=0; I< Level; i++) {sbtreehtml.append ("=\".. /images/white.gif\ ">"); Sbtreehtml.append ("\ n"); }//if ("N". Equals (Rs.getstring ("Is_leaf"))) {if (Constants.NO.equals (rs.getstring ")) {sbtreehtml.append ("<imgalt=\ "expand \"style=\ "Cursor:hand;\"OnClick=\ "Display ('"+ rs.getint ("id") + "'); \" ID=\ "img"+ rs.getint ("id") + "\" src=\".. /images/plus.gif\ ">"); Sbtreehtml.append ("\ n"); Sbtreehtml.append ("<imgID=\ "im"+ rs.getint ("id") + "\" src=\".. /images/closedfold.gif\ ">"); Sbtreehtml.append ("\ n"); Sbtreehtml.append ("<ahref=\ "client_node_crud.jsp?id="+ rs.getint ("id") + "\" Target=\ "Clientdispareaframe\">"+ rs.getstring (" name ") +"</a>"); Sbtreehtml.append ("\ n"); Sbtreehtml.append ("<Divstyle=\ "Display:none;\"ID=\ "Div"+ rs.getint ("id") + "\">"); Sbtreehtml.append ("\ n"); Readclienttree (Conn, rs.getint ("id"), level + 1); Sbtreehtml.append ("</Div>"); Sbtreehtml.append ("\ n"); }else {sbtreehtml.append ("<imgsrc=\".. /images/minus.gif\ ">"); Sbtreehtml.append ("\ n"); Sbtreehtml.append ("<imgsrc=\".. /images/openfold.gif\ ">"); Sbtreehtml.append ("\ n"); if ("Y1". Equals (Rs.getstring ("Is_client"))) {if (Constants.YES.equals (rs.getstring ("Is_client"))) { Sbtreehtml.append ("<ahref=\ "client_crud.jsp?id="+ rs.getint ("id") + "\" Target=\ "Clientdispareaframe\">"+ rs.getstring (" name ") +"</a>"); }else {sbtreehtml.append ("<ahref=\ "client_node_crud.jsp?id="+ rs.getint ("id") + "\" Target=\ "Clientdispareaframe\">"+ rs.getstring (" name ") +"</a>"); } sbtreehtml.append ("\ n"); } sbtreehtml.append ("</Div>"); Sbtreehtml.append ("\ n"); }}finally {Dbutil.close (RS); Dbutil.close (PSTMT); } }

DRP-Dynamic stitching number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.