1、怎么没有可能可能性是很大的大象进医院了insert into article values (null, 9, 1, 护士是蚂蚁在Myeclipse下创建一个web程序:图一修改webRoot下的index.jsp:(红色代码是有效代码,其他的为美工设计)%!private void tree(List articles, Connection conn, int id, int grade) String sql = select * from article where pid = + id; Statement stmt = DB.createStmt(conn); ResultSet
2、rs = DB.executeQuery(stmt, sql); try while (rs.next() Article a = new Article(); a.initFromRs(rs); a.setGrade(grade); articles.add(a); if (!a.isLeaf() tree(articles, conn, a.getId(), grade + 1); catch (SQLException e) e.printStackTrace(); finally DB.close(rs); DB.close(stmt); % List articles = new A
3、rrayList!DOCTYPE HTML PUBLIC -/W3C/DTD HTML 4.0 Transitional/ENhtmlheadtitleJava|Java世界_中文论坛|ChinaJavaWorld技术论坛 : Java语言*初级版meta http-equiv=content-type content=text/html; charset=GBKlink rel=stylesheet type=text/css href=images/style.css title=Integrated Stylesscript language=JavaScripttext/javascr
4、ipt src=images/global.js/scriptalternateapplication/rss+xmlRSSimages/common.js/headbodytable border=0 cellpadding= cellspacing= width=100% trtd width=140a href=images/header-left.gif alt=Java|Java世界_中文论坛|ChinaJavaWorld技术论坛 border=/a/tdtdimg src=images/header-stretch.gif height=571%images/header-righ
5、t.gif/tr/tbody/tablebrdiv id=jive-forumpagetr valign=top98%p class=jive-breadcrumbs论坛: Java语言*初级版 (模仿)jive-description 探讨Java语言基础知识,基本语法等 大家一起交流 共同提高!谢绝任何形式的广告 a id=jive-post-thread发表新主题3span class=nobreak 页: 1,316 - jive-paginator | class=1jive-current23456 99%jive-thread-listjive-tableList of thre
6、adstheadth class=jive-first colspan= 主题 jive-authornobr 作者 /nobrjive-view-count 浏览jive-msg-count nowrap=nowrap 回复 jive-last 最新帖子 for(Iterator it=articles.iterator();it.hasNext();) Article a = it.next(); String preStr = ; for(int i=0; itr class=jive-evenjive-bulletimages/read-16x16.gif已读- div-j
7、ive-thread-name95%jive-thread-1article_detail2.jsp?id=%=preStr+a.getTitle() % 104 5 by:jingjiangjun style=jingjiangjun » %- jive-oddjive-thread-2 兄弟们指点下那里 错误, 52 2 2007-9-13 上午8:40 jive-legend/body/html显示的界面是一个树状结构的:图二Index.jsp点击标题进入:图三% page contentType= language=java import=java.sql.* errorPa
8、ge=% page import=java.util.*%page import=com.lxy.BBS.DBcom.lxy.BBS.Article% String strId=request.getParameter(id int id=0; if(strId = null|strId.equals() out.println(Error1+ return ; try id=Integer.parseInt(strId); catch(NumberFormatException e)Error2 Article a =new Article(); Connection con=DB.getConn(); String str=select * from article where id=+id; Statement st=DB.createStmt(con); ResultSet rs=DB.executeQuery(st,str); if(rs.next() a.initFromRs(rs); DB.close(rs); DB.close(st); DB.close(con); 初学java遇一难题!望大家能帮忙一下 .jive-flatpage 2 Platform, Standard Edition (J2SE)jive-accountboxtable summar
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1