StringBuffer buffer = new StringBuffer(); buffer.append("INSERT INTO pfb.dbo."); if (!map.get("keyword").toString().equals("") && (map.get("pathname").toString().equals(""))) { buffer.append("Keyword"); } if (!map.get("pathname").toString().equals("") && (map.get("keyword").toString().equals(""))) { buffer.append("Imgpath"); } if (!map.get("keyword").toString().equals("") && !map.get("pathname").toString().equals("")) { buffer.append("INSERT INTO pfb.dbo.Keyword VALUES('" + map.get("keyword") + "','" + map.get("picturename") + "','" + map.get("turnurl") + "','" + map.get("justone") + "');INSERT INTO pfb.dbo.Imgpath VALUES('" + map.get("pathname") + "','" + map.get("picturename") + "','" + map.get("turnurl") + "','" + map.get("justone") + "');"); } if (buffer.indexOf("VALUES") < 0) { buffer.append(" VALUES('" + ((!map.get("keyword").equals("")) ? map.get("keyword") : map.get("pathname")) + "','" + map.get("picturename") + "','" + map.get("turnurl") + "','" + map.get("justone") + "')"); }
相关分类