锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品a区,在线播放视频一区,在线观看亚洲视频http://www.aygfsteel.com/human2008/category/28795.htmlzh-cnTue, 08 Jan 2008 15:21:18 GMTTue, 08 Jan 2008 15:21:18 GMT60- JSP瀹炵幇璁哄潧鏍戝瀷緇撴瀯鐨勭畻娉?闈為掑綊) http://www.aygfsteel.com/human2008/archive/2008/01/08/173769.html鐏?鐏?Tue, 08 Jan 2008 12:07:00 GMThttp://www.aygfsteel.com/human2008/archive/2008/01/08/173769.htmlhttp://www.aygfsteel.com/human2008/comments/173769.htmlhttp://www.aygfsteel.com/human2008/archive/2008/01/08/173769.html#Feedback0http://www.aygfsteel.com/human2008/comments/commentRss/173769.htmlhttp://www.aygfsteel.com/human2008/services/trackbacks/173769.html瀹炵幇璁哄潧鏍戝瀷緇撴瀯鐨勭畻娉曞緢澶氾紝榪欓噷鏄竴涓笉鐢ㄩ掑綊瀹炵幇鏍戝瀷緇撴瀯鐨勭畻娉?/font>
1.婕旂ず琛ㄧ殑緇撴瀯錛?nbsp;
銆銆銆琛ㄥ悕錛歮ybbslist
銆銆銆瀛楁 銆銆銆銆鏁版嵁綾誨瀷銆銆璇存槑
銆銆銆BBSID銆銆銆銆鑷姩緙栧彿 銆
銆銆銆RootID 銆銆銆Int銆銆銆銆 鏍瑰笘ID錛屾湰韜負鏍瑰笘鍒橰ootID = BBSID
銆銆銆FID銆銆銆銆銆Int 銆銆銆銆鐖跺笘ID錛屼笂涓灞傚笘瀛愮殑ID錛屽鏄牴甯栧垯FID = 0
銆銆銆DEPTH銆銆銆銆Int 銆銆銆銆鏍瑰笘Level=0錛屽叾浠栦緷鎹洖澶嶇殑娣卞害閫掑
銆銆銆BBSSubject 銆Char銆銆銆銆涓婚 |
2.鍒涘緩琛紙鍙牴鎹琛ㄧ殑緇撴瀯鍦ˋCCESS涓垱寤鴻〃錛夛細
create table mybbslist (
銆forumID int(20) not null,
銆bbsID int auto_increment primary key,
銆rootid int(20) not null,
銆fid int(20) not null,
銆depth int(20) not null,
銆userID int(20) not null,
銆bbsUser varchar(24) not null,
銆bbsSubject varchar(100) not null,
銆bbsContent text,
銆bbsTime varchar(30),
銆bbsRead int(20),
銆bbsReply int(20),
INDEX forumID (forumID)) |
3.婕旂ず璁哄潧鏍戝瀷緇撴瀯鐨凧SP紼嬪簭錛屾敞鎰忔紼嬪簭鍙涓涓牴璐磋繘琛屼簡婕旂ず錛堟暟鎹簱鐢ˋCCESS錛?
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%
String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
String connURL= "jdbc:odbc:cwb";
Connection conn = null;
Statement stmt = null;
int intRowCount;
out.print("鏄劇ず璁哄潧鏍戝艦緇撴瀯");
out.print("<br><br>");
try {
Class.forName(driverName);
conn = DriverManager.getConnection(connURL);
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
String sql="select * from mybbslist order by rootid desc,depth,fid,bbsid";
ResultSet rs = stmt.executeQuery(sql);
if (rs.next()){
rs.last();
intRowCount=rs.getRow();
out.print("璁哄潧鏍戜腑鏈?);
out.print(intRowCount);
out.print("涓彾瀛愯妭鐐?);
rs.first();
int j=0;
int Depth = 0;
out.print("<ul>");
while(j<intRowCount){
int rsDepth=rs.getInt("depth");
if (rsDepth>Depth){
out.print("<ul>");
}
out.print("<li>");
String bbssubject=rs.getString("bbsSubject");
out.print(bbssubject);
out.print("</li>");
Depth=rsDepth;
j=j+1;
rs.next();
}
for(int i=0;i<Depth+1;i=i+1) {
out.print("</ul>");
}
}else{
out.print("鏁版嵁搴撲腑鏃犺褰?);
}
}catch (SQLException E) {
out.println("SQLException: " + E.getMessage());
out.println("SQLState: " + E.getSQLState());
out.println("VendorError: " + E.getErrorCode());
}
%>
<% //鍏抽棴mysql榪炴帴
try {
if(conn!=null) conn.close();
} catch (Exception ex) {
System.err.println("closeConn: " + ex.getMessage());
}
%>
|

]]>
主站蜘蛛池模板:
呼和浩特市|
云霄县|
湖州市|
林芝县|
中宁县|
武宣县|
高碑店市|
安多县|
山东|
嘉禾县|
桑日县|
洱源县|
奇台县|
沙坪坝区|
澄迈县|
芷江|
谢通门县|
会泽县|
平度市|
惠州市|
横峰县|
杭锦旗|
巴楚县|
巴南区|
慈溪市|
遂昌县|
兴安盟|
龙里县|
铜山县|
左贡县|
阳高县|
西乌|
崇义县|
石渠县|
丽水市|
莫力|
阿城市|
陕西省|
平乡县|
汾西县|
曲阳县|