该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
//获取HashMap parameterList sqlScript 替换
ResultSet rs = db.QueryResultSet(null,"select sqlscript from rcm.t_datainterface_report where reportid = '" + reportID + "'");
System.out.println("rs====="+rs);
String sqlScript="";
if(rs.next())
{
sqlScript = rs.getString(0);
}
if(parameterList != null)
{
Iterator iter = parameterList.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry) iter.next();
String key =""+entry.getKey();
String value= ""+entry.getValue();
sqlScript.replace(key, value);
}
}
ResultSet res = (ResultSet) db.search(null, sqlScript);//字段,build_no,estaddrno,estroad,estname,estaddress
//我现在得到这个sql 然后 付给了 res 然后我执行这个sql语句的时候的字段是build_no,estaddrno,estroad,estname,estaddress 然后我怎么把这五个字段拼接成xml
ResultSetMetaData rsmd = res.getMetaData();
ArrayList resultList = new ArrayList();
xmlResult = xmlResult + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
xmlResult = xmlResult + " ";
while(res.next()){//把查询的值都循环出来.
Map map=new HashMap();
xmlResult = xmlResult + " ";
for (int i=0;i
//xmlResult = xmlResult + "";
xmlResult = xmlResult + ""+res.getString(i)+""+rsmd.getColumnName(i)+"> ";
//map.put(rsmd.getColumnName(i+1).toUpperCase(),rs.getObject(rsmd.getColumnName(i+1).toUpperCase()));
}
// resultList.add(map);
xmlResult = xmlResult + " ";
}
xmlResult = xmlResult + " ";
xmlResult = xmlResult + " ";
System.out.println(xmlResult);//输出检验
res.close();