📄 ajaxdispose.java
字号:
package util;
import java.sql.*;
/**
* @author Administrator
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class AjaxDispose {
public String getChildNodes(String id)
{
StringBuffer childs = new StringBuffer("<?xml version=\"1.0\" encoding=\"GBK\"?>");
try {
Conn conn = new Conn();
Connection con = conn.getConnection();
Statement stateMent = con.createStatement();
ResultSet rs = stateMent.executeQuery("select * from dictionary where parentItem = " + id);
String elementText = "";
String elementValue = "";
String elementCode = "";
String elementIsParent="";
String elementSrc="";
childs.append("<AllTrees>");
while(rs.next())
{
elementText = rs.getString("name");
elementValue = rs.getString("id");
elementCode = rs.getString("code");
elementIsParent = rs.getString("isparent");
elementSrc = rs.getString("src");
//childs.append("<City><MyCity><a href =\"javascript:requestSend("+elementValue+")\">"+elementText+"</a></MyCity></City>");
childs.append("<Trees><Tree id=\""+elementValue+"\" code=\""+elementCode+"\">"+elementText+"</Tree><IsParent>"+elementIsParent+"</IsParent><Src>"+elementSrc+"</Src></Trees>");
}
childs.append("</AllTrees>");
conn.disConnection();
stateMent.close();
rs.close();
}catch(Exception ex){
ex.printStackTrace();
}
return childs.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -