锘??xml version="1.0" encoding="utf-8" standalone="yes"?>www亚洲一区,一二三四社区欧美黄,亚洲综合在线播放http://www.aygfsteel.com/human2008/category/28795.htmlzh-cnTue, 08 Jan 2008 15:21:18 GMTTue, 08 Jan 2008 15:21:18 GMT60JSP瀹炵幇璁哄潧鏍戝瀷緇撴瀯鐨勭畻娉?闈為掑綊) 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()); 

%> 



鐏? 2008-01-08 20:07 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 安庆市| 斗六市| 阿克苏市| 敦煌市| 公主岭市| 济宁市| 乐业县| 西充县| 城固县| 三台县| 金坛市| 山东| 台中市| 贵德县| 江津市| 随州市| 承德市| 璧山县| 五常市| 乐昌市| 和顺县| 宜宾市| 大城县| 正蓝旗| 大邑县| 红桥区| 宝丰县| 六盘水市| 文化| 二连浩特市| 神池县| 静安区| 莱西市| 喜德县| 大渡口区| 四川省| 章丘市| 桦南县| 诸暨市| 高清| 茂名市|