/** 获取本区督导病案核实失败数据* */
public String getKqBaFromGxsjrz(Map<String, String> params) {
List<String> bldjglkInfoList=new ArrayList<String>();
String ret = "<?xml version='1.0'?><data><state>0</state><exceptionstring></exceptionstring><infolist>";
XStream xstream = new XStream();
xstream.alias("BldjglkInfo", List.class);
String sql = "SELECT YWXML FROM JB_JH_GXSJRZ WITH(NOLOCK)";
IResultHandler irh = new BldjglkInfoRsHandler();
try {
bldjglkInfoList = (List<String>) ServerSQLExecutorUtils.executeQuery(sql, null, irh);
for (String bldjglkInfo : bldjglkInfoList) {
List<BldjglkInfo> infolist = (List<BldjglkInfo>) xstream.fromXML(bldjglkInfo);
BldjglkInfo info=infolist.get(0);
ret+=info.toStringWithOutNullValue();
}
} catch (SQLException e) {
e.printStackTrace();
}
ret+="</infolist></data>";
return ret;
}
class BldjglkInfoRsHandler implements IResultHandler
{
public Object handlerResult(ResultSet rs) throws SQLException {
List<String> list = new ArrayList<String>();
while (rs.next()) {
list.add(rs.getString("YWXML"));
}
return list;
}
}
内部类解析sql查询获取的数据结果
最新推荐文章于 2023-05-22 00:01:15 发布