K
kevin1779
Unregistered / Unconfirmed
GUEST, unregistred user!
正在开发一商务平台,遇到了一个问题,搞的头晕脑胀!
请高手帮助!
关于分类的问题,比如:总的目录,下面又分了几层,怎样
去一层层的实现?
我的代码贴出来,请各位帮我改改或者有更好的方法!谢谢!
public String ShowMainCatalog(String s) throws Exception {
String s3 = "";
try {
String s1 = "SELECT * FROM " + s;
ResultSet resultset = dbconn.ExeQuery(s1);
for(s3 = s3 + "<tr>";resultset.next();s3 = s3 + "") {
int i = resultset.getInt("id");
String s2="select * from caloag";
ResultSet resultset1=dbconn.ExeQuery(s2);
s3 = s3 + "<td width=130 height=11><a href="+SystemURL+"second.jsp&id="+String.valueOf(i)+">"+changer(resultset.getString("father"))+"</a></td>";//关键在这里,如何实现下一层的寻找???
if (i%4==0)
s3 = s3 + "</tr>";
}
dbconn.CloseConn();
}
catch(SQLException sqlexception) {
System.err.println("aq.executeQuery:" + sqlexception.getMessage());
}
return s3;
}
请高手帮助!
关于分类的问题,比如:总的目录,下面又分了几层,怎样
去一层层的实现?
我的代码贴出来,请各位帮我改改或者有更好的方法!谢谢!
public String ShowMainCatalog(String s) throws Exception {
String s3 = "";
try {
String s1 = "SELECT * FROM " + s;
ResultSet resultset = dbconn.ExeQuery(s1);
for(s3 = s3 + "<tr>";resultset.next();s3 = s3 + "") {
int i = resultset.getInt("id");
String s2="select * from caloag";
ResultSet resultset1=dbconn.ExeQuery(s2);
s3 = s3 + "<td width=130 height=11><a href="+SystemURL+"second.jsp&id="+String.valueOf(i)+">"+changer(resultset.getString("father"))+"</a></td>";//关键在这里,如何实现下一层的寻找???
if (i%4==0)
s3 = s3 + "</tr>";
}
dbconn.CloseConn();
}
catch(SQLException sqlexception) {
System.err.println("aq.executeQuery:" + sqlexception.getMessage());
}
return s3;
}